﻿<!DOCTYPE html>
<html>
<head>
<title>饭桶 - 网上订餐,速度像疯了一样!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<!--[if IE 8]>
	<meta http-equiv="X-UA-Compatible" content="IE=Emulate7"/>
<![endif]-->
<meta name="keywords" content="飞饭,飞饭网,西安外卖,长春外卖,湛江外卖,珠海外卖,连云港外卖,北京外卖,外卖电话,西安在线叫外卖,西安网上订餐,西安外卖网,西安订餐网" />
<meta name="description" content="飞饭提供全西安,长春,湛江,珠海,连云港,北京,最专业在线免费订餐服务，从您附近喜欢的餐厅订购美食，网上下单，送餐上门。订外卖，找飞饭" />
<link rel="shortcut icon" type="image/x-icon" href="http://www.flymeal.cn:80/assets/images/favicon.ico" />
<link href="/Css/common.css" rel="stylesheet" type="text/css"/>
<link href="/Css/foodlist.css" rel="stylesheet" type="text/css"/>

<script src="/Scripts/jquery-1.11.1.min.js" type="text/javascript"></script>

</head>
<body>
<div class="g-doc" id="container">
	<a name="toTop" href="#"></a>

<!-- <meta content="webkit" name="renderer"/> -->
<link href="/Css/header.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 8]>
	<link href="/Css/ie67.css" rel="stylesheet" type="text/css"/>
<![endif]-->
<script src="/Scripts/jquery-1.11.1.min.js" type="text/javascript"></script>
<!--[if lte IE 8]>
	<script type="text/javascript" src="/Scripts/json2.min.js"></script>
<![endif]-->
<script type="text/javascript" src="/Scripts/jquery.easing.1.3.min.js"></script>
<script type="text/javascript" src="/Scripts/jquery.cookie.js"></script>
<div class="g-hd f-shadow" style="position: initial;overflow: visible;">
	<div class="g-panel f-14 f-f f-fwn" style="position: initial;overflow: visible;">
		<div class="left">
			<a class="l-hd download" href="/customer/mobile.html" target="_blank">手机客户端</a>
		</div>
		<div class="menu_pannel">
		<div class="right m-menu-width" id="loginDown">
		<span class="m-login">
		<a href="{{url('auth/login')}}" class="l-hd" id="login-id">登录</a>
		<a href="{{url('auth/register')}}" class="l-hd">注册</a>
		</span>
		</div><a id='m29'>
		</a>
		</div>
		<div class="right">
			<a href="javascript:void(0);" class="l-hd" id="shoppingCartTitle">美食车(0)</a>
			<a href="/orderhistory" class="l-hd">我的订单</a>
			<a	href="/pre" class="l-hd">积分换礼</a>
			<a href="#"	class="f-csd line">|</a>
		</div>
		<!-- <a class="l-logo " href="/" title="叫外卖 上飞饭" ></a> -->
		<a class="l-logo"  href="/">
			<img src="/Images/ft_logo.gif" alt="饭桶" title="像疯一样的快!">
		</a>
	</div>
</div>

<div class="headerShadow" id="headerShadow">
	<div class="content_2" >
		<div class="ameche-close f-all" id="ameche-close"></div>
		<div class="ameche-content" id="content_2">暂无信息</div>
		<div class="ameche-ok">
		</div>
	</div>
	<div class="mask"></div>
</div>
<script type="text/javascript">
function showHeaderShadow(args){
	if(args.div_=='请先登陆'){
		//timer = setInterval(timeIn3,1000);
		$('#content_2').html("您未登录!<br/><div style='font-size:14px;' >您可<a class='c-ff6931' href='auth/login' >去登录</a>，或<a class='c-ff6931' href='javascript:void(0)' onclick='showHeaderShadowHidden()' >返回抢购页面</a>.</div>");
	}else{
		$('#content_2').html(args.div_);
	}
	if(args.callback!=undefined){
		args.callback();
	}
	$('#headerShadow').css({'display':'block'});
}
var s = 5,timer = '';
function timeIn3(){
	s--;
	$('#content_2').html("您未登录,<br/>您可<a class='c-ff6931' href='auth/login' >去登录</a>，或<a class='c-ff6931' href='javascript:void(0)' onclick='showHeaderShadowHidden()' >返回抢购页面</a>.");
	if(s==0){
		window.location = "auth/login";
	}
}
function showHeaderShadowHidden(){
	$('#headerShadow').css({'display':'none'});
}
/*function loginID(){
	var s_ = (window.location.href.replace("http://localhost:8080",'').replace("http://172.16.180.120:8080",'').replace('http://121514.vicp.cc','').replace('https://www.flymeal.cn','').replace('http://www.flymeal.cn',''));
	if(s_!=null&&(s_.indexOf('/logout')<0)){
		$('#login-id').attr('href',$('#login-id').attr('href')+"?backUrl="+s_);
	}
}*/
$(function(){
	loginID();
	$('#ameche-close').click(showHeaderShadowHidden);
	var menus = {
		show:function(){
           	$("#m-menu").css({"display":"block",
                   "height":"0px"});
           	$("#m-menu").animate({
                   "height":"190"
               },200,function(){});
		}
	};
	$('.username-label').hover(function(e){
		//menus.show();
	},function(e){
		//alert(e.target.className);
	});
    $("#loginDown").click(function(e){
    	/* if($(this).find('.username-label').length>0){
    		var menu = $("#m-menu");
            if($("#m-menu").css("display") == "none"){
            	$("#m-menu").css({"display":"block",
                    "height":"0px"});
            	$("#m-menu").animate({
                    "height":"190"
                },200,function(){});
            }else{
            	$("#m-menu").hide();
            }
    	}
        e.stopPropagation(); */
        /* e.preventDefault(); */
    });
    $("#m-menu li").click(function(e){
        var path = $(this).attr('path');
        if(path){
	        window.location = '' + path;
        }
        $("#m-menu").hide();
        e.stopPropagation();
        e.preventDefault();
    });

    var cookieFS = {
    	ordersNum:function(cookie_){
    		var totalNum = 0;
    		if(cookie_.productList!=null && cookie_.productList.length>0){
    			for (var int_ = 0; int_ < cookie_.productList.length; int_++) {
					totalNum += cookie_.productList[int_].num;
				}
    		}
    		return totalNum;
    	},
    	checkCart:function(){
    		var args_ = {
   					div_:"<div class='Restdif'><div class='f-all codemobile' ></div><div><div class='t rmobit'>"+
						"<div class='t23'>您选择的菜品低于起送价！</div>"+
					"<div class='actions'><div class='btn_91_28 f-radius-4 f-fr okmobile'>确定</div></div></div></div>",
					callback:function(){
						$('.Restdif .okmobile').click(function(){
							showHeaderShadowHidden();
						});
					}
			}
			showHeaderShadow(args_);
    	}
    };

	var str =  $.cookie('shoppingCart');
	if(str!=null&&jQuery.trim(str)!=''){
		var obj = '';
		try  {
			obj = eval('(' + str + ')');
			$('#shoppingCartTitle').html('美食车(' + cookieFS.ordersNum(obj) + ')');
		}catch(exception){
			$('#shoppingCartTitle').html('美食车(0)');
			return;
		}
	}else{
		$('#shoppingCartTitle').html('美食车(0)');
	}
	orderMsgs.initFromCookie();
	$("#shoppingCartTitle").click(function(e){
		e.preventDefault();
		var meishic = $.cookie('shoppingCart');
		if(meishic==null){
			var id_={supplierId:null,productList:[]};
			$.cookie('shoppingCart', JSON.stringify(id_), { path: '/', expires: 60*60*12 })
		}/* else{
			cookieFS.checkCart();
		} */
		window.location = "/shoppingCart";
	});
});
$(document).bind('click',function(ev){
    var ev=ev||window.event;
    var elem=ev.target||ev.srcElement;
    if(elem.id!="m-menu"){
        var menu = $("#m-menu");
        if(menu.css("display") !== "none"){
           //menu.hide();
        }
    }
    if($(elem).parents('#menu-catalog').length>0){
    	return false;
    }
    if(($(elem).parents('#list-detail').length==0)){
        $("#list-detail").hide();
    }
});


var orderMsgs = new orderMsgs();

function getCustomerId(){
	if($('#customerId').length!=0){
		return $('#customerId').val();
	}else{
		return "-1";
	}
}

function setCustomerMsg(customerMsg){
	var strHtml = '<ul>';
	var showFlag = 0;
	$('#msg').empty();
	if(customerMsg == null || trim(customerMsg) == ''){
		$('#msg').hide();
	}else{
		var msgs = customerMsg.split(';');
		for(var i=0; i<msgs.length; i++){
			var strs = msgs[i].split(':');
			if(msgs[i] == null || trim(msgs[i]) == ''){
				continue;
			}else if(strs[0] == 'unreadSiteMail'){
				if(parseInt(strs[1]) > 0){
					strHtml += '<li>' + strs[1] + '条新的站内信，<a id="siteMail" href="' + getRootPath() + '/my/message">点击查看</a></li>';
					showFlag++;
				}
			}else if(strs[0] == 'unapprovalOrder'){
				if(parseInt(strs[1]) > 0){
					strHtml += '<li>' + strs[1] + '个未评价订单，<a id="apprivalOrder" href="' + getRootPath() + '/my/orderHistory">点击查看</a></li>';
					showFlag++;
				}
			}else{
				switch(strs[1]){
					case '3':strs[1] = '已接收';showFlag++;break;
					case '4':strs[1] = '已派送';showFlag++;break;
					case '5':strs[1] = '已取消';showFlag++;break;
				}
				strHtml += '<li>1份订单' +strs[1] + '，<a id="' + strs[0] + '" class="diliveryOrder">点击查看</a></li>';
			}
		}
		if(showFlag<=0){
			return;
		}
		strHtml += "</ul>";
 		strHtml += '<a href="javascript:void(0);" class="nn-ce" id="crossD"></a>';
		$('#msg').append(strHtml);

		$('.diliveryOrder').unbind('click');
 		$('.diliveryOrder').click(function(){
 			var swf = getSWF('pushCustomerMsg');
 			swf.deleteOrderMsg(getCustomerId(), $(this).attr('id'));
			window.location = getRootPath() + '/my/todayOrder';
 	 	});

 		$('#crossD').unbind('click');
 		$('#crossD').click(function(){
 			$('#msg').hide();
 	 	});

		$('#msg').show();
	}
}
function getSWF(movieName){
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        return window[movieName];
    }
    else
    {
        return document[movieName];
    }
}
function orderMsgs(){
	this.customerId = null;
	this.msgs = new Array();
	this.initFromCookie = function(){
		var str =  $.cookie('orderMsgs');
		if(str!=null&&jQuery.trim(str)!=''){
			var obj = '';
			try  {
				obj = eval('(' + str + ')');
			}catch(exception){
				this.customerId = null;
				this.msgs = new Array();
				this.refrushCookie();
				return;
			}
			this.customerId = obj.customerId;
			this.msgs = obj.msgs;
		}else{
			this.customerId = null;
			this.msgs = new Array();
			this.refrushCookie();
		}
	};
	this.refrushCookie = function(){
		$.cookie('orderMsgs', JSON.stringify(this), { path: '/', expires: 60*60*4 });
	};
}

function orderMsg(){
	this.orderSequence = null;
	this.orderStatus = null;
}

/*----------------------------------------
 * 说明：javascript的加减乘除结果会有误差，这个函数返回较为精确的结果。
 ----------------------------------------*/
//除法函数
//用法：accDiv(arg1,arg2)
//@return arg1除以arg2的精确结果
//@remark 本函数压缩后可能出现t1、t2未初始化问题
function accDiv(arg1,arg2){
	var t1=0,t2=0,r1,r2;
	try{t1=arg1.toString().split(".")[1].length;}catch(e){}
	try{t2=arg2.toString().split(".")[1].length;}catch(e){}
	with(Math){
		r1=Number(arg1.toString().replace(".",""));
		r2=Number(arg2.toString().replace(".",""));
		return (r1/r2)*pow(10,t2-t1);
	}
}
//乘法函数
function accMul(arg1,arg2){
	var m=0,s1=arg1.toString(),s2=arg2.toString();
	try{m+=s1.split(".")[1].length;}catch(e){}
	try{m+=s2.split(".")[1].length;}catch(e){}
	return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m);
}
//加法函数
function accAdd(arg1,arg2){
	var r1,r2,m;
	try{r1=arg1.toString().split(".")[1].length;}catch(e){r1=0;}
	try{r2=arg2.toString().split(".")[1].length;}catch(e){r2=0;}
	m=Math.pow(10,Math.max(r1,r2));
	return (arg1*m+arg2*m)/m;
}
//减法函数
function accSub(arg1,arg2){
    var r1,r2,m,n;
    try{r1=arg1.toString().split(".")[1].length;}catch(e){r1=0;}
    try{r2=arg2.toString().split(".")[1].length;}catch(e){r2=0;}
    m=Math.pow(10,Math.max(r1,r2));
    //动态控制精度长度
    n=(r1>=r2)?r1:r2;
    return ((arg1*m-arg2*m)/m).toFixed(n);
}
//js中的toFixed方法也有精度问题
Number.prototype.toFixed=function(len){
	var add = 0,s;
	var s1 = this + "";
	var start = s1.indexOf(".");
	if(s1.substr(start+len+1,1)>=5){add=1;}
	var temp = Math.pow(10,len);
	s = Math.floor(this * temp) + add;
	return s/temp;
};
</script>

	<div class="back" data-url="hunantesecaiguan" id="back">
	</div>
    <div class="g-bd">
        <div class="g-menu f-f f-14">
            <div class="m-cf f-shadow-con f-radius" id="restaurant-panel">
                <div class="logo">


						<img src='/Images/f682e268394c40b38129558958352f56.png' width="66px" height="66px"/>



                </div>
                <div class="title" id="i-resturant"
                		data-id = "4858"
                		data-name = "{{$stores->sname}}"
                		data-url = "hunantesecaiguan"
                		data-deliveryCharge = "0.0"
                		data-deliveryTime = "30"
                		data-deliveryLeastValue = "10"

                		data-serviceStatus = "1"
                		data-openTimePm = "12:00"
                		data-openTimeAm = "10:30"
                		data-closeTimeAm = "12:00"
                		data-closeTimePm = "21:00"
                	>
                    <h3 class="f-dian c-24231e" data-id = 4858  id="supplierName_">
                     	<a href="/hunantesecaiguan" id="supplierName_span" title="{{$stores->sname}}" >{{$stores->sname}}</a>

                     	@if($stores->status == 1)
                     	<span class="status service_status_0" id="status_resturant">正在营业</span>
                     	@elseif($stores->status == 0)
                     	<span class="status service_status_0" id="status_resturant" style="color:gray;">暂停营业</span>
                     	@endif

                     </h3>
                    <span class="f-fl f-s4">

                    	<div class='f-start resStar





	                                       				stars-{{$stores->lev}}-0




	                                       			 f-fen-4'></div>
                    </span>
                    <span class="f-14 num c-999">{{$stores->lev}}</span>
                    <span class="f-13 liang"> 月销量{{$zynum}}份</span>
                </div>
                <div class="nav f-18" id="i-nav">
                    <a class="l-nav hover f-radius-4" href="javascript:void(0);" tab-tag="menu" id="id-menu-item">菜单</a>
                    <a class="l-nav" href="javascript:void(0);" tab-tag="comment">评价</a>
                    <a class="l-nav" href="javascript:void(0);" tab-tag="lan">留言</a>
                </div>

                <div class="sudu" style="border-color:#fff;">
                	<div style="margin-top: 5px;">
                		<span class="f-36">
                    	30</span><span class="f-14">分钟</span>
                    <p class="f-13">送餐速度</p></div>
                </div>
                <div class="sudus" >
                	<div style="margin-top: 5px;">
                		<span class="f-36"  id="deliveryLeastValue">{{$stores->qsjg}}</span><span class="f-14">元</span>
                    <p class="f-13">起送价</p></div>
                </div>
            </div>


            <div class="m-cg">
            	<div class="left">
                <div class="left-item left-menus tag-menu left-db" id="i-panel-menu">
                    <div class="m-nav f-shadow-con f-radius">
                        <div class="title f-radius-top">
                        	   菜品分类
                        	 <div style="display: inline;float: right;font-weight: normal;">
                        	 	<div class="tr3 f-fl" style="margin-right: 10px;"><a href="javascript:void(0);" class="l-xl hover2 f-radius-4 item-default">默认排序</a></div>
		                         <div class="tr4 f-fl" style="margin-right: 10px;"><a href="javascript:void(0);" class="l-xl  f-radius-4 item-sales">销量<i class="f-all class_down"></i></a></div>
		                         <div class="tr5 f-fl" style="margin-right: 20px;"><a href="javascript:void(0);" class="l-xl  f-radius-4 item-price">价格<i class="f-all class_up"></i></a></div>
		                         <div class="tr6 f-fr">
		                             <input class="search f-radius-4" hit="cc" placeholder="输入拼音或汉字"  type="text" id="searchInput2" onkeyup="this.setAttribute('value',this.value);"/>
		                         </div>
                        	 </div>
                        </div>
                        <ul>

									@foreach($category as $c)
									<li>
										<a href="javascript:void(0);" class="l-menu" title="{{$c->lname}}" test="{{$c->lid}}    "
											to="a_">

										  	{{$c->lname}}


										</a>
									</li>
									@endforeach


                        </ul>
                        <div class="clear"></div>
                    </div>

                    <div class="list f-shadow-con f-radius">
                        <div class="m-top f-dn">
                            <div class="title f-fl">菜品分类</div>
                            <div class="tr1 f-fl" id="menu-catalog">
                            	<a href="javascript:void(0);" class="l-fl " >菜品分类</a>
                            	<i class="menu-down f-all"></i>
                            </div>
                            <div class="tr2 f-fl">|</div>
                            <div class="tr3 f-fl"><a href="javascript:void(0);" class="l-xl hover2 f-radius-4 item-default">默认排序</a></div>
                            <div class="tr4 f-fl"><a href="javascript:void(0);" class="l-xl   f-radius-4 item-sales">销量<i class="f-all class_down"></i></a></div>
                            <div class="tr5 f-fl"><a href="javascript:void(0);" class="l-xl   f-radius-4 item-price">价格<i class="f-all class_up"></i></a></div>
                            <div class="tr6 f-fr">
                                <input class="search f-radius-4" hit="cc" placeholder="输入拼音或汉字"  type="text" id="searchInput"/>
                            </div>
                            <div class="list-detail" id="list-detail">
                                <div class="triangle"></div>
                                <ul>




										@foreach($category as $c)
											<li>
												<a href="#{{$c->lname}}" class="l-menu" title="{{$c->lname}} " test="{{$c->lid}}    "
													to="a_">



												    	{{$c->lname}}

												</a>
											</li>
										@endforeach



		                        </ul>
                            </div>
                        </div>



                        <div  class="m-dztj js-list">


                            <ul class="tu">


                            </ul>
                            <div class="clear"></div>
                        </div>

                        @foreach($category as $c)
                       		<div  class="m-cai js-list m-list0">
                        		<a name="{{$c->lname}}"></a>
								<div class="title" >
									<span>
										{{$c->lname}}
									</span>
								</div>
								<ul>
										@foreach($mlist as $m)
										@if($m->lid == $c->lid)
										<li class="l-list f-csp"
												product-id="{{$m->mid}}"
												product-price="{{$m->mprice}}"
												product-name="{{$m->mname}}"
												product-namePy="shan:yao:tu:ji"
												product-combType="0"
												product-buyCount ="0"
												product-time ="15-6-29 14:43:32.060"
												product-packing ="0.0"
											>
		                                    <div class="name" title="{{$m->mname}}">{{$m->mname}}</div>
		                                    <div class="ad"></div>
		                                    <div class="cart">


													<a href="javascript:void(0);" class="l-gwc"></a>


		                                    </div>
		                                    <div class="price">￥{{$m->mprice}}</div>
		                                    <div class="sale f-12">月售{{$m->ynum}}份</div>
		                                    <div class="num f-12"><a class="f-radius" href="javascript:void(0);"></a></div>
		                                </li>
									@endif
									@endforeach
                                </ul>
                                </div>
                            @endforeach





                    </div>
                </div>
                <div class="left-item left-comment tag-comment" id="i-panel-comment">
                    <div class="m-eva f-shadow-con f-radius" id="comment-ctner">
                        <div class="title f-radius-top">全部评价</div>
                        <div id="commnet-list">
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="left-item left-lan tag-lan" id="i-panel-lan">
                    <div class="m-eva f-shadow-con f-radius">
                        <div  class="m-hdong js-list">
                        	<a name="comments-title"></a>
                        	<a href="#comments-title" id="comment-id-href"></a>
                            <div class="title f-radius-top">发表留言</div>
                            <a name="hreflan"></a>
                            <div class="message">
                                <textarea id="lanText" data-type='1'></textarea>
                                <input type="hidden" id="comment-id"/>
                            </div>
                            <div class="message last">
                                    <div class="f-fl"><input class="ipt f-fc-b7b7b7 f-14 f-ff-my" id="captcha" style="width:100px;"  type="text" placeholder="请输入验证码"  autocomplete="off" /></div>
                                    <div class="f-fl yzm"><img id="captha_img" src="/Images/captcha_signup.jpg" height="32px"/></div>
                                    <div class="f-fl yzmwz" ><a href="javascript:void(0);" class="f-fc-ff7744 f-12" id="change_captha_img">看不清，换一张</a></div>
                                    <div class="f-fr"><button id='submit-lan' class="f-radius f-14 btn-warning f-ff-my">提交留言</button></div>
                                    <div class="clear"></div>
                            </div>
                        </div>
                        <div class="m-hdong js-list">
                        	<div class="title noline"><span>全部留言</span></div>
                        </div>
                        <div class="lan-ctner" id="lan-ctner"></div>
                        <div class="clear"></div>
                    </div>
                    <div class="clear"></div>

                </div>
                <div class="clear"></div>
                <div id="Pagination" class="pagination"></div>
                <div id="Pagination1" class="pagination"></div>
            	</div>
                <div class="right">
                    <div class="left-item notice tag-menu tag-lan f-shadow-con f-radius left-db" id="i-notice">
                        <div class="title f-radius-top">餐厅公告</div>
                        <div class="con first">

                        		(暂无公告)


                        </div>
                        <div class="con">
                            <table>
                                <tr>
                                    <td>派送时间：</td><td>10:30~12:00 </td>
                                </tr>
                                <tr>
                                    <td></td><td>12:30~21:00</td>
                                </tr>
                            </table>
                        </div>


                        <div class="con">
                       		     地址：长安大学本部
                        </div>
                        <div class="con">
                           	送餐费：0.0元
                        </div>
                        <div>

                        	 	<div class="con con-1 jdb hod3">
                                       <img src="/Images/payment.png" class="isPayment" width="16" height="16" border="0"/>
                                       	支持在线支付
                                 </div>


                        </div>
                    </div>
                    <div class="left-item notice tag-comment f-shadow-con f-radius" id="i-notice-comment">
                        <div class="con m-fenye">
                            <div class="f1">
                                <div class="f-fl f-60">{{$stores->lev}}</div>
                                <div class="f-fl f2">
                                    <div><span class="f-fl f-start f-s4


	                                       				stars-3-0


	                                       			"></span></div>
                                    <div class="comment_num">
                                    21人评价</div>
                                </div>
                            </div>
                            <div class="f3">
                                <span class="f-fl f-start f-s5 stars-5-0"></span>
                                <div class="m-wpx f-fl" style="width:100px;"></div>
                                <div class="f-fl num">8</div>
                                <div class="clear"></div>
                            </div>
                            <div class="f4">
                                <span class="f-fl f-start f-s4 stars-4-0"></span>
                                <div class="m-wpx f-fl" style="width:80px;"></div>
                                <div class="f-fl num">3</div>
                                <div class="clear"></div>
                            </div>
                            <div class="f4">
                                <span class="f-fl f-start f-s3 stars-3-0"></span>
                                <div class="m-wpx f-fl" style="width:50px;"></div>
                                <div class="f-fl num">4</div>
                                <div class="clear"></div>
                            </div>
                            <div class="f4">
                                <span class="f-fl f-start f-s2 stars-2-0"></span>
                                <div class="m-wpx f-fl" style="width:20px;"></div>
                                <div class="f-fl num">2</div>
                                <div class="clear"></div>
                            </div>
                            <div class="f4 f5">
                                <span class="f-fl f-start f-s1 stars-1-0"></span>
                                <div class="m-wpx f-fl" style="width:10px;"></div>
                                <div class="f-fl num">4</div>
                                <div class="clear"></div>
                            </div>

                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="claer60"></div>
    </div>
    <!-- body end -->

   <div id="ball" class="u-ball"></div>

</div>
<!-- cart start -->
<div class="left-item m-cart f-14 f-f tag-menu notice left-db" id="m-cart">
    <div class="list f-shadow-con f-radius-top" id="m-cart-title">
        <div class="title">
            <span class="t1">菜品<a href="javascript:;" class="l-cart" id='clear-cart'>[清空]</a></span>
            <span class="t2">份数</span>
            <span class="t3">小计</span>
        </div>
        <ul>
        </ul>
        <div class="other-charge">
        <div class="clearfix packing-cost hidden">
          <span class="fl">餐盒费</span>
          <span class="fr boxtotalprice">￥0.0</span>
        </div>
        <div class="clearfix delivery-cost">
          <span class="fl">送餐费</span>
          <span class="fr shippingfee">￥0.0</span>
        </div>
    </div>
    </div>
    <div class="bottom f-shadow-con">
        <div class="num f-18"><div class="i-gwc f-allS numCart">0</div></div>
        <span class="f-18 price" id='totalValue'>￥0.0</span>
        <a href="javascript:void(0);" class="f-radius f-16 sendTips  f-ff-my go-orders" id='submitOrder'>还差{{$stores->qsjg}}元起送</a>
    </div>

</div>






<link href="/Css/footer.css" rel="stylesheet" type="text/css" />
<div class="footer">
    <div class="g-ft">
        <div class="normal f-f f-14">
            <div class="con">
                <div class="left">
                    <div>
                        <a href="javascript:void(0);" class="l-ft feedback_btn0">新版反馈</a>
                        <a href="javascript:void(0);" class="f-csd l-ft">|</a>
                        <a href="/my/openShop" class="l-ft">我要开店</a>
                        <a href="javascript:void(0);" class="f-csd l-ft">|</a>
                        <a href="/about/us" class="l-ft">联系我们</a>
                        <a href="javascript:void(0);" class="f-csd l-ft">|</a>
                        <a href="/about/recruit" target="_blank" class="l-ft">招聘精英</a>
                        <a href="javascript:void(0);" class="f-csd l-ft">|</a>
                        <a href="/about/problems" class="l-ft">帮助中心</a>
                    </div>
                    <div class="icp">© 2009 - 2014  飞饭  陕ICP备10006969号</div>
                </div>
                <div class="left">
                    <div class="center"><a href="http://wljg.xags.gov.cn/bscx.do?method=hddoc&amp;id=61013100001555" class="f-img" border="0"></a></div>
                </div>
                <div class="right">
                    <a href="/customer/mobile.html?ios=1" target="_blank"><img src="/Images/d-apple.png"></a>
                    <a href="/customer/mobile.html" target="_blank"><img src="/Images/d-android.png"></a>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="feedback_pop" class="pop f-ff-my">
	<div class="c">
		<div class="t">问题反馈</div>
		<div name="step_1">
			<ul class="type">
				<li t="1" tips="请描述您的问题或想法" class="t1 active">意见</li>
				<li t="2" tips="请描述您的问题" class="t2">疑问</li>
				<li t="3" tips="请描述一下这个错误和正确的信息" class="t3">纠错</li>
				<li t="4" tips="请详细说明举报的问题，请勿恶意举报" class="t4">举报</li>
				<li t="5" tips="觉得飞饭很棒就大声的告诉我们吧，您的称赞会让我们更用心做到最好" class="t5">表扬</li>
			</ul>
			<div class="report_type"><b>举报原因：</b><select name="report_type">
				<option value="">请选择</option>
				<option value="内容反动">内容反动</option>
				<option value="暴力色情">暴力色情</option>
				<option value="非法广告">非法广告</option>
				<option value="不文明语言">不文明语言</option>
				<option value="恶意网址举报">恶意网址举报</option>
			</select><input type="hidden" name="report_id" value="" /></div>
			<div><textarea name="content" class="content" tips=" "></textarea></div>
			<div class="rest_name"><input type="text" name="rest_name" tips="请填写餐馆名称" /></div>
			<div class="submit btn_82_27 btn_82_26">提交</div>
		</div>
		<div name="step_2">
			<div class="notify">为了您能够及时的得到反馈，请</div>
			<div class="login">
				<div class="sub">登录飞饭：</div>
				<div class="tip" style="color:#f00;">账号或密码输入错误，请重新输入</div>
				账号：<input type="text" name="uname" class="input_1" tips="请输入您的用户名/手机/邮箱" /><br />
				密码：<input type="password" name="upassword" class="input_1" />
				<div class="sub">或输入常用邮箱：</div>
				邮箱：<input type="text" name="uemail" class="input_1" tips="您的常用邮箱地址" />
			</div>
			<div class="submit btn_82_27 btn_82_26">提交</div>
			<div class="clear"></div>
		</div>
		<div name="step_3">
			<div class="alertText">请稍候……</div>
		</div>
		<div name="step_4">
			<div class="alertText">问题提交成功！</div>
		</div>
		<div name="step_5">
			<div class="alertText">好像出了点小问题，请稍后重试。</div>
		</div>
		<div class="tel">客服热线：029-82582110</div>
		<div class="close">&times;</div>
	</div>
	<div class="mask"></div>
</div>
<div style = "display:none;"><script src="/Scripts/stat.js" language="JavaScript"></script></div>
<script type="text/javascript">
function resetFooter_2(){
	 if($("#container").length==1){
	    	var arg_css = {'height':'auto'};
	    	if(($("#container").height()+$("#container").offset().top+130)>$(window).height()){
	    		$('.footer').css({'position':'relative'});
	    		arg_css.height = 'auto';
	    		$('body').css(arg_css);$('html').css(arg_css);
	    	}else{
	    		arg_css.height = '100%';
	    		$('.footer').css({'position':'absolute'});
	    		$('body').css(arg_css);$('html').css(arg_css);
	    	}
	    }
}
var feedback = {
		isLogin: typeof(ISLOGIN) == 'undefined' ? false : ISLOGIN,
		init: function(){
			$('.feedback_btn0').click(function(){
				feedback.isLogin = $('#loginHref').length > 0 ? false: true;
				$('#feedback_pop [name^=step_]').hide();
				$('.tip').hide();
				$('#feedback_pop [name=step_1]').show();
				var t = $(document).scrollTop()+$(window).height()/2-150;
				$('#feedback_pop .c').css('top', t+'px');
				$('#feedback_pop').show();
				if($('#feedback_pop [name=content]').hasClass('inputTips')) $('#feedback_pop .type li:first').click();
			});
			$('#feedback_pop .type li').click(function(){
				$('#feedback_pop .type li').removeClass('active');
				$(this).addClass('active');
				var t = $(this).attr('t');
				var content = $('#feedback_pop [name=content]');
				content.attr('tips', $(this).attr('tips')).removeClass('s');
				if(content.hasClass('inputTips')) content.val('').focusout();
				$('#feedback_pop .rest_name, #feedback_pop .report_type').hide();
				if(t == 3) {
					$('#feedback_pop .rest_name').show();
					content.addClass('s');
				}
				else if(t == 4) {
					$('#feedback_pop .report_type').show();
					content.addClass('s');
				}
			});
			$('#feedback_pop .submit').click(function(){
				var wrong = false;
				$('#feedback_pop [name=step_1] :input:visible').each(function(){
					if(trim($(this).val()) == '' || $(this).hasClass('inputTips')) {
						alert('请填写完整必要内容。');
						wrong = true;
						return false;
					}
				});
				if(wrong) return;
				if(feedback.isLogin) feedback.submit();
				else if($('#feedback_pop [name=step_1]').css('display') == 'none') {
					var uname = $('#feedback_pop [name=uname]');
					var upassword = $('#feedback_pop [name=upassword]');
					var uemail = $('#feedback_pop [name=uemail]');
					if((uname.val() == '' || upassword.val() == '' || uname.hasClass('inputTips') || upassword.hasClass('inputTips')) && (uemail.val() == '' || uemail.hasClass('inputTips'))) {
						alert('请至少选择一种方式。');
						return;
					}
					feedback.submit(uname.val(), upassword.val(), uemail.val());
				}
				else {
					$('#feedback_pop [name^=step_]').hide();
					$('#feedback_pop [name=step_2]').show();
					//if($.browser.msie && $.browser.version < 7) $('#feedback_pop .tel').hide().show();
				}
			});
		},
		submit: function(uname, upassword, uemail) {
			$('#feedback_pop [name^=step_]').hide();
			var params = {
				t: 0,
				q_cat: $('#feedback_pop .type .active').attr("t"),
				q_content: $('#feedback_pop [name=content]').val(),
				q_report_type:null,
				q_report_id:0,
				q_rest_name:null,
				uname:null,
				upassword:null,
				uemail:null
			};
			var report_type = $('#feedback_pop [name=report_type]').val();
			var report_id = $('#feedback_pop [name=report_id]').val();
			var rest_name = $('#feedback_pop input[name=rest_name]').val();
			var page_rest_name = $("#companyName").val();
			if(report_type != '') params.q_report_type = report_type;
			if(report_id != '') params.q_report_id = report_id;
			if(rest_name != '') {
				params.q_rest_name = rest_name;
			} else {
				params.q_rest_name = page_rest_name;
			}
			if(!feedback.isLogin) {
				if(uname != '' && upassword != '') {
					params.t = 1;
					params.uname = uname;
					params.upassword = upassword;
				}
				else {
					params.t = 2;
					params.uemail = uemail;
				}
			}
			$.ajax({
		        url : getRootPath()+'/customerajax/feedbackinfo!addFeedback.action',
		        data: params,
		        cache : false,
		        async : true,
		        type : "POST",
		        dataType : 'json',
		        beforeSend	: function(xmlHttpRequest){
		        	$('#feedback_pop [name=step_3]').show();
				},
		        success : function (data){
		        	$('#feedback_pop [name=step_3]').hide();
		        	feedback.done(data);
		        },
		        error	:	function(){
		        	$('#feedback_pop [name=step_5]').show();
		        }
		    });
		},
		done: function(d) {
			if(d.errorCode != '') {
				$('#feedback_pop [name=step_2]').show();
				$('.tip').show();
				return;
			}
			$('#feedback_pop [name^=step_]').hide();
			$('#feedback_pop [name=step_4]').show();
			if((d.q_cat == 3)&&(d.t == 0||d.t == 1)){
				pointsPop.gen(20, '#feedback_pop [name=step_4] .alertText');
			}
			$('#feedback_pop .type li').removeClass('active');
			$('#feedback_pop .type li:first').addClass('active');
			$('#feedback_pop [name=content]').val('').focusout();
			$('#feedback_pop [name=uname]').val('').focusout();
			$('#feedback_pop [name=upassword]').val('');
			$('#feedback_pop [name=uemail]').val('').focusout();
		}
};
function initPopup() {
	//if($.browser.msie && $.browser.version < 7) $('.pop .mask').css('height', $(document).height()+'px');
	$('.pop .close').click(function(){$(this).parent().parent().hide();});
}
$(function(){
	feedback.init();
	initPopup();
	//resetFooter();
	resetFooter_2();
	var toTop = {
			_:function(){
				$("#i-toTop").click(function(){
					$('html,body').animate({scrollTop:0},500);
				});
			}
	};
	toTop._();
});
$(document).bind('click',function(ev){
    var ev=ev||window.event;
    var elem=ev.target||ev.srcElement;
    resetFooter_2();
});
$(window).resize(function(){
	resetFooter_2();
});
function init(){}
function initBody(){}
//trim
 function trim(str) {
	//var str = str.replace(/^\s\s*/, ''),
	ws = /\s/,
	i = str.length;
	while (ws.test(str.charAt(--i))){}
	return str.slice(0, i + 1);
}
function getRootPath(){
	return window.location.protocol+'//'+window.location.host;
}
function resetFooter(){}


</script>
<div id="olContent">
	<div class="f-pop-l f-radius-15 f-fs16 f-fc-707070 f-ff-my" id="f-pop-l-address" style="display: block;">
	   	<div class="f-p-t15 shouji dialog-item">
	   		<img src="/Images/promotionspop.png"  />
		   	<div class="goon" id='goon'></div>
	   	</div>
	   	<div class='dialog dialog-item'>
		   	<div class="c" >
				<div class="t" id='text_'>组合菜最多由三份组合而成哦！</div>
				<div class="actions">
					<div name="ok" id="ok_2" class="btn_91_28">确定</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div id="overlay">
</div>
<div class="toTop f-all" id="i-toTop"><a href="#toTop0"></a></div>
<script type="text/javascript"  CHARSET="UTF-8">
/****分页勿动 BEGIN */
    jQuery.fn.pagination=function(f,a){a=jQuery.extend({items_per_page:10,num_display_entries:10,current_page:0,num_edge_entries:0,link_to:"#",prev_text:"Prev",next_text:"Next",ellipse_text:"...",prev_show_always:!0,next_show_always:!0,callback:function(){return!1}},a||{});return this.each(function(){function n(){var b=Math.ceil(a.num_display_entries/2),d=Math.ceil(f/a.items_per_page),g=d-a.num_display_entries,g=e>b?Math.max(Math.min(e-b,g),0):0,b=e>b?Math.min(e+b,d):Math.min(a.num_display_entries,d);
        return[g,b]}function l(b,d){e=b;m();var g=a.callback(b,h);g||(d.stopPropagation?d.stopPropagation():d.cancelBubble=!0);return g}function m(){h.empty();var b=n(),d=Math.ceil(f/a.items_per_page),g=function(a){return function(b){return l(a,b)}},k=function(b,c){b=0>b?0:b<d?b:d-1;c=jQuery.extend({text:b+1,classes:""},c||{});var f=b==e?jQuery("<span class='current'>"+c.text+"</span>"):jQuery("<a>"+c.text+"</a>").bind("click",g(b)).attr("href",a.link_to.replace(/__id__/,b));c.classes&&f.addClass(c.classes);
        h.append(f)};a.prev_text&&(0<e||a.prev_show_always)&&k(e-1,{text:a.prev_text,classes:"prev"});if(0<b[0]&&0<a.num_edge_entries){for(var m=Math.min(a.num_edge_entries,b[0]),c=0;c<m;c++)k(c);a.num_edge_entries<b[0]&&a.ellipse_text&&jQuery("<span>"+a.ellipse_text+"</span>").appendTo(h)}for(c=b[0];c<b[1];c++)k(c);if(b[1]<d&&0<a.num_edge_entries)for(d-a.num_edge_entries>b[1]&&a.ellipse_text&&jQuery("<span>"+a.ellipse_text+"</span>").appendTo(h),c=Math.max(d-a.num_edge_entries,b[1]);c<d;c++)k(c);a.next_text&&
    (e<d-1||a.next_show_always)&&k(e+1,{text:a.next_text,classes:"next"})}var e=a.current_page;f=!f||0>f?1:f;a.items_per_page=!a.items_per_page||0>a.items_per_page?1:a.items_per_page;var h=jQuery(this);this.selectPage=function(a){l(a)};this.prevPage=function(){return 0<e?(l(e-1),!0):!1};this.nextPage=function(){return e<Math.ceil(f/a.items_per_page)-1?(l(e+1),!0):!1};m();a.callback(e,this)})};
/****分页勿动 END */
var funParabola = function(element, target, options) {
    var defaults = {
        speed:166.67,
        curvature:.003,
        progress:function() {},
        complete:function() {
            $(element).remove();
        }
    };
    var params = {};
    options = options || {};
    for (var key in defaults) {
        params[key] = options[key] || defaults[key];
    }
    var exports = {
        mark:function() {
            return this;
        },
        position:function() {
            return this;
        },
        move:function() {
            return this;
        },
        init:function() {
            return this;
        }
    };
    var moveStyle = "margin", testDiv = document.createElement("div");
    if ("oninput" in testDiv) {
        [ "", "ms", "webkit" ].forEach(function(prefix) {
            var transform = prefix + (prefix ? "T" :"t") + "ransform";
            if (transform in testDiv.style) {
                moveStyle = transform;
            }
        });
    }
    var a = params.curvature, b = 0, c = 0;
    var flagMove = true;
    if (element && target && element.nodeType == 1 && target.nodeType == 1) {
        var rectElement = {}, rectTarget = {};
        var centerElement = {}, centerTarget = {};
        var coordElement = {}, coordTarget = {};
        exports.mark = function() {
            if (flagMove == false) return this;
            if (typeof coordElement.x == "undefined") this.position();
            element.setAttribute("data-center", [ coordElement.x, coordElement.y ].join());
            target.setAttribute("data-center", [ coordTarget.x, coordTarget.y ].join());
            return this;
        };
        exports.position = function() {
            if (flagMove == false) return this;
            var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft, scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
            if (moveStyle == "margin") {
                element.style.marginLeft = element.style.marginTop = "0px";
            } else {
                element.style[moveStyle] = "translate(0, 0)";
            }
            rectElement = element.getBoundingClientRect();
            rectTarget = target.getBoundingClientRect();
            centerElement = {
                x:rectElement.left + (rectElement.right - rectElement.left) / 2 + scrollLeft,
                y:rectElement.top + (rectElement.bottom - rectElement.top) / 2 + scrollTop
            };
            centerTarget = {
                x:rectTarget.left + (rectTarget.right - rectTarget.left) / 2 + scrollLeft,
                y:rectTarget.top + (rectTarget.bottom - rectTarget.top) / 2 + scrollTop
            };
            coordElement = {
                x:0,
                y:0
            };
            coordTarget = {
                x:-1 * (centerElement.x - centerTarget.x),
                y:-1 * (centerElement.y - centerTarget.y)
            };
            b = (coordTarget.y - a * coordTarget.x * coordTarget.x) / coordTarget.x;
            return this;
        };
        exports.move = function() {
            if (flagMove == false) return this;
            var startx = 0, rate = coordTarget.x > 0 ? 1 :-1;
            var step = function() {
                var tangent = 2 * a * startx + b;
                startx = startx + rate * Math.sqrt(params.speed / (tangent * tangent + 1));
                if (rate == 1 && startx > coordTarget.x || rate == -1 && startx < coordTarget.x) {
                    startx = coordTarget.x;
                }
                var x = startx, y = a * x * x + b * x;
                if (moveStyle == "margin") {
                    element.style.marginLeft = x + "px";
                    element.style.marginTop = y + "px";
                } else {
                    element.style[moveStyle] = "translate(" + [ x + "px", y + "px" ].join() + ")";
                }
                if (startx !== coordTarget.x) {
                    params.progress(x, y);
                    window.requestAnimationFrame(step);
                } else {
                    params.complete();
                    $(element).hide();
                    flagMove = true;
                }
            };
            window.requestAnimationFrame(step);
            flagMove = false;
            return this;
        };
        exports.init = function() {
            this.position().mark().move();
            $(element).show();
        };
    }
    return exports;
};

 var favor_ = {
		 delFavor:function (args){
			 $.ajax({
					url: '/customerajax/favor!deleteFavorite.action',
					data: args.data,
					type: 'post',
					dataType: 'json',
					success: function(d) {
						if(d.errorCode != '') return;
						if($('.l-shoucang').hasClass('l-shoucang-hover')){
							$('.l-shoucang').removeClass('l-shoucang-hover');
						}
						$('#favor').html('未收藏');
					}
				});
		 },
		 addFavor:function(args){
			 $.post('/customerajax/favor!favor.action',args, function(data){
					if(data.errorCode != null && data.errorCode.length > 0) {
						alert(errorCode);
					} else {
						$('.l-shoucang').addClass('l-shoucang-hover');
						$('.l-shoucang').attr('favorid',data.favorId);
						$('#favor').html('已收藏');
					}
				});
		 },
		 selectFavor:function(args){
			 $.post('/customerajax/favor!isFavor.action',args, function(data){
					if(data.errorCode != null && data.errorCode.length > 0) {
						alert(errorCode);
					} else {
						if(!!data.isFavor){
							$('.l-shoucang').addClass('l-shoucang-hover');;
							$('.l-shoucang').attr('favorid',data.favorId);
							$('#favor').html('已收藏');
						}else{
							$('.l-shoucang').removeClass('l-shoucang-hover');;
							$('#favor').html('未收藏');
						}
					}
				});
		 }
 };
function favor() {
	var isLogin = $('.username-label').length == 0 ? false: true;
	if(!isLogin){
		var args_ = {
				div_:"<div class='Restdif'><div class='t'>"+
				'<div class="t23">先登录才能收藏餐馆哦！</div>'+
			"<div class='actions'><div class='btn_91_28 f-radius-4 f-fr ok23'>确定</div></div></div>",
				callback:function(){
					$('.Restdif .ok23').click(function(){
						showHeaderShadowHidden();
					});
				}
		}
		showHeaderShadow(args_);
	}else{
		if($('#isFavor').hasClass('l-shoucang-hover')){
			favor_.delFavor({data:{id:$('.l-shoucang').attr('favorid')}});
		}else{
			favor_.addFavor({supplierid:$('#i-resturant').attr('data-id')});
		}
	}
}
var $shop = $('.m-cart .bottom'),       //点击购物车
$body = $('.m-cart .list'),        //购物车列表
$numall = $('.m-cart .bottom .num'),   //购物车数量
$listDetail = $("#list-detail");
var page = {
		init:function(){
			page.comment();
			page.lan();
			$('#submit-lan').click(page.add);
			page.lanReply();
		},
		comment:function(args_){
			var com = $("#i-resturant");
			var param = {supplierid: com.attr("data-id"),currPage : 0,pageSize:10};
			$.post("/customerajax/hotComments!load.action",param,function(data){
				page.commentPagination(data);
			});
		},
		commentPagination:function(data){
			var opt = {
				    callback: page.pageselectCallback,//点击事件回调
				    items_per_page:10,//每页显示的数据数量
				    num_display_entries:3,//省略号前最少显示几项
				    num_edge_entries:3,//省略号后显示几项
				    next_text:">",
				    prev_text:"&lt;"
				};
			$("#Pagination").pagination(data.totalNum, opt);//15为记录总数
		},
		pageselectCallback: function(page_index, jq){
			var com = $("#i-resturant");
			var param = {supplierid: com.attr("data-id"),currPage : 0,pageSize:10};
			param.currPage = page_index;
			$.post("/customerajax/hotComments!load.action",param,function(data){
				if(data.comments!=null&&data.comments.length==0){
					$("#Pagination").removeClass('left-db');
					var sTemp = "<div class='m-eva-list comments-none' >"+
	                "" + "<div class='f-fl m-ly'>"+
	                    "<span class='name'></span><span class='f-fr time datetime'></span><span class='f-fr time date'></span> "+
	                    "<div class='con content' style='text-align:center;'>本店开张不久还没有顾客评价</div><div class='replyCtner'>";
	                $("#commnet-list").html(sTemp);
					return;
				}
				var $m = "<div  class='m-hdong'>\
		                    <div class='m-eva-list'> \
		                    <div class='f-fl s1'><img src='"+
		                		"' height='39px' width='39px' class='img-user'/></div> \
		                    <div class='f-fl s2'>\
		                        <span class='name'></span>\
		                        <span class='time date'></span><span class='time datetime'></span>\
		                        <div class='con content'>\
		                        </div>\
		                    </div>\
		                    <div class='f-fl s3'>\
		                        <div><span class='f-fl txt'>综合评价</span><span class='f-fl f-start f-s3  comment-stars'></span></div>\
		                        <div class='txt-margin'><span class='f-fl txt '>菜品质量</span><span class='f-fl comments'></span></div>\
		                        <div><span class='f-fl txt'>速度评价</span><span class='f-fl comment-speed'></span></div>\
		                    </div>\
		                    <div class='clear'></div>\
		                </div>\
		            </div>";
		            $("#commnet-list").html('');
				for(var i = 0,len = data.comments.length;i<len;i++){
					var $mc = $m;
					$mc = $($mc).attr("data-id",data.comments[i].id);
					$('.date',$mc).html(data.comments[i].commentsTime.substring(0,10));
					$('.img-user',$mc).attr('src',data.comments[i].customPortrait=='default'?'assets/images/portrait.png':data.comments[i].customPortrait);
					$('.datetime',$mc).html(data.comments[i].commentsTime.substring(11));
					$('.content',$mc).html(data.comments[i].commentsContent);
					var point = "stars-"
					if(parseFloat(data.comments[i].gradePoint)<2){
						point +="1-0";
					}else if(parseFloat(data.comments[i].gradePoint)<3.0){
						point +="2-0";
					}else if(parseFloat(data.comments[i].gradePoint)<4.0){
						point +="3-0";
					}else if(parseFloat(data.comments[i].gradePoint)<5.0){
						point +="4-0";
					}else if(parseFloat(data.comments[i].gradePoint)==5.0){
						point +="5-0";
					}
					$('.comment-stars',$mc).addClass(point);;
					$('.name',$mc).html(data.comments[i].customerName);;

					var velo = {'1':'差','2':'一般','3':'好','4':'很好','5':'非常好'};
					$('.comments',$mc).html(velo[data.comments[i].productQuality]);;
					$('.comment-speed',$mc).html(data.comments[i].velocity+"分钟");
					$("#commnet-list").append($mc);
					resetFooter_2();
				}
			});
			return false;
		},
		lan:function(args_){
			var com = $("#i-resturant");
			var param = {supplierid: com.attr("data-id"),currPage : 0,pageSize:10};
			$.post('/customerajax/comment!load.action', param, function(data){
				var opt = {
					    callback: pageselectCallbackLan,//点击事件回调
					    items_per_page:10,//每页显示的数据数量
					    num_display_entries:3,//省略号前最少显示几项
					    num_edge_entries:3,//省略号后显示几项
					    next_text:">",
					    prev_text:"&lt;"
					};
				$("#Pagination1").pagination(data.totalNum, opt);//15为记录总数
				function pageselectCallbackLan(num_index,jq){
					var com = $("#i-resturant");
					var param = {supplierid: com.attr("data-id"),currPage : 0,pageSize:10};
					param.currPage = num_index;
					$.post('/customerajax/comment!load.action', param, function(data){

						if(data.comments.length==0){
							$("#Pagination1").removeClass('left-db');
							if($(".lan-ctner .m-eva-list").length>0){
								$(".lan-ctner").html('');
							}
							var sTemp = "<div class='m-eva-list comments-none' >"+
			                ""+
			                "<div class='f-fl m-ly'>"+
			                    "<span class='name'></span><span class='f-fr time datetime'></span><span class='f-fr time date'></span> "+
			                    "<div class='con content' style='text-align: center;'>本店开张不久还没有顾客留言</div><div class='replyCtner'>";

						sTemp  += "</div>\
			                    <p><span class=''></span><span class='f-fr f-radius l-btn-jb time'></span></p> \
			                </div> \
			                <div class='clear'></div> \
			            </div>";
						$('.lan-ctner').append(sTemp);
							return;
						}
						$('.lan-ctner').html('');
						for ( var j = 0,len = data.comments.length;j<len;j++) {
							var sTemp = "<div class='m-eva-list' data-id='"+data.comments[j].id+"' data-name='"+data.comments[j].speakerName+"'>"+
				                "<div class='f-fl s1'><img src="+(data.comments[j].customPortrait==undefined?'assets/images/portrait.png':data.comments[j].customPortrait)
				                +" height='39px' width='39px'/></div> "+
				                "<div class='f-fl m-ly'> "+
				                    "<span class='name'>"+data.comments[j].speakerName+"</span><span class='f-fr time datetime'>"+data.comments[j].timeComment.substring(11)+"</span><span class='f-fr time date'>"+data.comments[j].timeComment.substring(0,10)+"</span> "+
				                    "<div class='con content'>"+data.comments[j].mainContent+ "</div><div class='replyCtner'>";
							var jkTem = "";
							for(var k = 0,kLen = data.comments[j].replies.length;k<kLen;k++){
								 var skTem = "<div class='huifu'> \
					            		<p><span class='replier'>"+data.comments[j].replies[k].speakerName+"</span>&nbsp;&nbsp;&nbsp;&nbsp;回复<span class='f-fr time replyDatetime'>"+data.comments[j].replies[k].timeComment.substring(11)+"</span><span class='f-fr time replyDate'>"+data.comments[j].replies[k].timeComment.substring(0,10)+"</span></p> \
					            		<div class='replyContent'>"+data.comments[j].replies[k].mainContent+"</div> \
					        		</div>";
								jkTem += skTem;
							}
							sTemp  += jkTem;
							sTemp  += "</div>\
				                    <p><a href='#hreflan'><span class='f-fr time l-btn-hc f-radius report'>回复</span></a><span class='f-fr f-radius l-btn-jb time report2'>举报</span></p> \
				                </div> \
				                <div class='clear'></div> \
				            </div>";
							$('.replyCtner',sTemp).html(jkTem);
							$('.lan-ctner').append(sTemp);
						}
			        	page.lanReply();
			        	resetFooter_2();
					});
				}
			});
		},
		addLan:function(){
			var com = $("#i-resturant");
			var params = {
					supplierid: com.attr("data-id"),
					supplierName: com.attr("data-name"),
					commentid: $(""),
					mainContent: form.find('[name=content]').val(),
					captcha: form.find('[name=captcha]').val(),
					type: type
			};
			$.post('/customerajax/comment!add.action', params, function(data){});
		},
		add: function() {
			var form = $(this).parent();
			var $text_ = $('#lanText');
			var mainContent = $.trim($text_.val());
			var type = $text_.attr('data-type');
			if (mainContent == null || mainContent == "") {
				alert("留言不能为空，说点什么吧！");
				return false;
			}
			var com = $("#i-resturant");
			var params = {
					supplierid: com.attr("data-id"),
					supplierName: com.attr("data-name"),
					commentid: $('#comment-id').val(),
					mainContent: mainContent,
					captcha: $('#captcha').val(),
					type: type
			};
			$.post('/customerajax/comment!add.action', params, function(data){
				if(data.errorCode != null && data.errorCode != "") {
					var args_ = {
							div_:"<div class='Restdif'><div class='t'>"+
							'<div class="t23">'+data.errorCode+'</div>'+
						"<div class='actions'><div class='btn_91_28 f-radius-4 f-fr ok23'>确定</div></div></div>",
							callback:function(){
								$('.Restdif .ok23').click(function(){
									showHeaderShadowHidden();
								});
							}
					}
					showHeaderShadow(args_);
				}else{
					$('#lanText').val('');
					$('#captcha').val('');
					$('#change_captha_img').click();
					page.lan();
					return;
					/* var commentid = $('#comment-id').val();
					if(commentid == null || commentid == ''){
						var sTemp = "<div class='m-eva-list' data-id='"+data.comments[0].id+"' data-name='"+data.comments[0].speakerName+"'> \
		                <div class='f-fl s1'><img src='/Images/portrait.png' height='39px' width='39px'></div> \
		                <div class='f-fl m-ly'> \
		                    <span class='name'>"+data.comments[0].speakerName+"</span><span class='f-fr time datetime'>"+data.comments[0].timeComment.substring(11)+"</span><span class='f-fr time date'>"+data.comments[0].timeComment.substring(0,10)+"</span> \
		                    <div class='con content'> \
		                    "+data.comments[0].mainContent+"\
		                    </div> \
		                    <div class='replyCtner'>";
						sTemp  += "</div>\
			                    <p><span class='f-fr time l-btn-hc f-radius report'>回复</span><span class='f-fr f-radius l-btn-jb time report2'>举报</span></p> \
			                </div> \
			                <div class='clear'></div> \
			            </div>";
			            $('.lan-ctner').prepend(sTemp);
			            $('#lanText').attr('data-type','1');
						page.lanReply();
					}else{
						page.lan();
						var skTem = "<div class='huifu'> \
		            		<p><span class='replier'>"+data.comments[0].speakerName+"</span>&nbsp;&nbsp;&nbsp;&nbsp;回复<span class='f-fr time replyDatetime'>"+data.comments[0].timeComment.substring(11)+"</span><span class='f-fr time replyDate'>"+data.comments[0].timeComment.substring(0,10)+"</span></p> \
		            		<div class='replyContent'>"+data.comments[0].mainContent+"</div> \
		        		</div>";
						$('div[data-id='+commentid+']').find('.replyCtner').append(skTem);
						$('#lanText').val('');
						$('#comment-id').val('');
						 $('#lanText').attr('data-type','1');
					} */
				}
				$('#captcha').val('');
				$('#change_captha_img').click();
			});

		},
		lanReply :function(){//留言回复
			$(".report").click(function(e){
				e.stopPropagation();
				$('#comment-id').val($(this).closest(".m-eva-list").attr("data-id"));
				var receiver = "对";
				receiver += $(this).closest(".m-eva-list").attr("data-name");
				receiver += "的回复:";
				$('#lanText').attr('data-type','2');
				$('#lanText').val(receiver);
				$("#comment-id").click();
			});
			$(".report2").click(function(e){
				e.stopPropagation();
				$('.feedback_btn0').click();
				$('#feedback_pop .type li[t=4]').click();
				$('#feedback_pop [name=report_id]').val($(this).parents('.m-eva-list').attr('data-id'));
			});
		}
	};
	page.init();//分页初始化
$(window).resize(function(){
	layoutBack();
});
function layoutBack(){
	$("#back").css({top:$("#restaurant-panel").offset().top,left:$("#restaurant-panel").offset().left-60,display:'block'}).click(function(){
		window.location = "/";
	});
}
/* function  restFootersInPage(){
	if($(window).height()>$('html').height()){
		$('body').height($(window).height()-130);
	}else{
		$('body').height('100%');
	}
} */
(function(){
	   function initShoppingCartH(){
	    	if($('#m-cart ul').height()>500){
				$('#m-cart ul').css({
					height:'510px',
					overflow:'auto'
				});
			}else{
				$('#m-cart ul').css({
					height:'auto',
					overflow:'visible'
				});
			}
	    }
	 var tab_ = {
			 initTab:function(){
				 var tab_ =$.cookie('tab-tag');
					if((tab_!=null)&&($('a[tab-tag='+tab_+']').length>0)){
						$('a[tab-tag='+tab_+']').click();
					}
			 }
	 };
	 var tools = {
	    		menu_:function(){
	    			var $mTop = $(".m-top");
	    			$mTop.removeClass("fixer");
	                $mTop.addClass("f-dn");
	                $listDetail.css({"display":"none"});
	    		},
	    };
    //功能面板切换
	$("#i-nav a").click(function(){
		$(this).siblings("a").removeClass("hover f-radius-4").end().addClass("hover f-radius-4");
		$(".left-item").removeClass("left-db");
		$("#Pagination").removeClass("left-db");
		$("#Pagination1").removeClass("left-db");
		$(".tag-"+$(this).attr("tab-tag")).addClass("left-db");
		$.cookie('tab-tag', $(this).attr('tab-tag'), { path: '/', expires: 60*60*12 });
		if($(this).attr("tab-tag")!="menu"){
			if($(this).attr("tab-tag")!="lan"){
				$("#Pagination").addClass("left-db");
				page.comment();
			}else{
				$("#Pagination1").addClass("left-db");
				page.lan();
			}
			tools.menu_();
		}
		$('.m-top').removeClass("fixer");
		$('.m-top').addClass("f-dn");
	});
    function validNum(){
    	var args_ = {
				div_:"<div class='Restdif'><div class='t'>"+
				"<div class='t23'>数据格式不正确</div>"+
			"<div class='actions'><div class='btn_91_28 f-radius-4 f-fr ok23'>确定</div></div></div>",
				callback:function(){
					$('.Restdif .ok23').click(function(){
						showHeaderShadowHidden();
					});
				}
		}
		showHeaderShadow(args_);
    }
	var menu = {
		init:function(){
			$("#back").css({top:$("#restaurant-panel").offset().top,left:$("#restaurant-panel").offset().left-60,display:'block'}).click(function(){
				window.location = "/";
			});;
		}
	},
	newShop = {
    		inputNum:function(){//通过美食车输入菜品数量
    	    	$("#m-cart input").bind("input propertychange", function() {
    	    		var name = $(this).parent('div').prev('div').html(),val_ = $(this).val();
    	    		var input_text = $(this).val();
    	    		if(isNaN(input_text)||(input_text<1)){//
    	    			$(this).val(1);
    	    			val_ = 1;
    	    		}
    	    		for(var k7 =0; k7< shoppingCookie.productList.length;k7++){
    	    			if(shoppingCookie.productList[k7].name==name){
    	    				shoppingCookie.productList[k7].num = val_;
    	    				listCartProducts();
    	    				break;
    	    			}
    	    		}
    	    	});
    		},
    		minusPlus:function(){
    			$('.plus').click(function(){
    				var val_ = parseFloat($(this).siblings('input').val()),name = $(this).closest('div').prev('div').html();
    	    		for(var k7 =0; k7< shoppingCookie.productList.length;k7++){
    	    			if(shoppingCookie.productList[k7].name==name){
    	    				shoppingCookie.productList[k7].num = (val_-1);
    	    				if(shoppingCookie.productList[k7].isCombine){
    	    				}else{
    	    					if(shoppingCookie.productList[k7].num==0){
		    	    				$('li[product-id='+$(this).closest('li').attr('product-ids')+']',$('.m-list0')).find('.num a').removeClass('num_not_0').html('');
	    	    				}else{
	    	    					$('li[product-id='+$(this).closest('li').attr('product-ids')+']',$('.m-list0')).find('.num a').html(shoppingCookie.productList[k7].num);
	    	    				}
    	    				}
    	    				listCartProducts();
    	    				break;
    	    			}
    	    		}
    			});
    			$('.minus').click(function(){
    				var val_ = parseFloat($(this).siblings('input').val()),name = $(this).closest('div').prev('div').html();
    	    		for(var k7 =0; k7< shoppingCookie.productList.length;k7++){
    	    			if(shoppingCookie.productList[k7].name==name){
    	    				shoppingCookie.productList[k7].num = (val_+1);
    	    				if(shoppingCookie.productList[k7].isCombine){
    	    				}else{
    	    					if(shoppingCookie.productList[k7].num==0){
		    	    				$('li[product-id='+$(this).closest('li').attr('product-ids')+']',$('.m-list0')).find('.num a').removeClass('num_not_0').html('');
	    	    				}else{
	    	    					$('li[product-id='+$(this).closest('li').attr('product-ids')+']',$('.m-list0')).find('.num a').html(shoppingCookie.productList[k7].num);
	    	    				}
    	    				}
    	    				listCartProducts();
    	    				break;
    	    			}
    	    		}
    			});
    		},
    		checkPhone:function(){
    			var args_ = {
						div_:"<div class='check_ctner'></div>",
						callback:function(){

						}
				}
				showHeaderShadow(args_);
    		},
    		submitOrders:function(){
    			$("#submitOrder").click(function(){
    				if($(this).html().indexOf('去结算')>-1){
    					var sH = '';
    					var totalValue = 0,val_num = 0;
    					var k0_  = new Array();
    					for(var k0 = 0;k0<shoppingCookie.productList.length;k0++){
    						if(shoppingCookie.productList[k0].num==0){
    							k0_.push(k0);
    						}else{
    							val_num += parseInt(shoppingCookie.productList[k0].num);
    						}
    					}

    					shoppingCookie.num = val_num;
    					shoppingCookie.price = totalValue;
    					var cookie_ = cookieFun.cookieFormt(shoppingCookie);
    					$.cookie('shoppingCart', JSON.stringify(cookie_), { path: '/', expires: 60*60*12 });
    					window.location = "/shoppingCart";
    				}
    			});
    		}
    },
	bean = {
	    	half:[],
	    	halfs:{
	    		name:'',
	    		price:0,
	    		isCombine:true,
	    		num:0,
	    		productId:null,
	    		packing:0,
	    		combineList:[]
	    	},
	    	halfCombineList:[

	    	                 ],
	        productList:[]
	    },
	   shoppingCookie = {
	    	supplierId:$('#i-resturant').attr('data-id'),
	    	urlName:$('#i-resturant').attr('data-url'),
	    	customerId:null,
	    	supplierName:$('#i-resturant').attr('data-name'),
	    	phoneNum:null,
	    	deliveryCharge:$('#i-resturant').attr('data-deliverycharge'),
	    	deliveryLeastValue:$('#i-resturant').attr('data-deliveryLeastValue'),
	    	deliveryTime:$('#i-resturant').attr('data-deliveryTime'),
	    	price:0,
	    	packing:0,
	    	productList:[],
	    	num:0
	    },
		sort_ = {
				byNumPirceDefault:function(args){
					$('.left-menus .js-list').each(function(index,item){
						if($('li',this).length<=1){return;}
						for(var i = 0;i<$('li',this).length;i++){
	                        for(var j =i;j>0;j--){
	                        	if(args.type=="product-buycount"){//销量降序
	                        		if((parseInt($($('li',this)[j]).attr('product-buycount'))>parseInt($($('li',this)[j-1]).attr('product-buycount')))){
	                                    $($('li',this)[j]).insertBefore($($('li',this)[j-1]));
	                                }
	                        	}else if(args.type=="product-price"){//价格升序序
	                        		if((parseFloat($($('li',this)[j]).attr('product-price'))<parseFloat($($('li',this)[j-1]).attr('product-price')))){
	                                    $($('li',this)[j]).insertBefore($($('li',this)[j-1]));
	                                }
	                        	}else if(args.type=="product-time"){//默认从
	                        		var date1 = $($('li',this)[j]).attr('product-time');
	                        		date1 = date1!=null?date1.replace(/\-/g,''):'';
	                        		var date2 = $($('li',this)[j-1]).attr('product-time');
		                        	date2 = date2!=null?date2.replace(/\-/g,''):'';
	                        		if((new Date(date1))>new Date(date2)){
	                        			$($('li',this)[j]).insertBefore($($('li',this)[j-1]));
	                        		}
	                        	}

	                        }
	                    }
					});
				},
				search_:function(args){
					if(args==undefined){
						resetFooter_2();
						return false;
					}
					if($('#'+args).val()==''){
						$('.left-menus .js-list li').removeClass('spec-py-dn');
						resetFooter_2();
						return false;
					}
					$('.left-menus .js-list li').each(function(index,item){
						var PName = $(this).attr('product-name');
						var PNamePy = $(this).attr('product-namepy');
						var searchStr = $('#'+args).val();
						var visible = sort_.checkPinYinMatch(PName, PNamePy, searchStr);
						if(!visible){
							$(this).addClass('spec-py-dn');
						}else{
							$(this).removeClass('spec-py-dn');
						}
						resetFooter_2();
					});
				},
				checkPinYinMatch :function(cn, pinYin, searchStr){
					if(cn==undefined){return true}
					if(((cn!=null))&&(cn!=undefined)&&cn.indexOf(searchStr)!=-1){
						return true;//可见
					}
					if(cn.indexOf(searchStr)>-1){
						return false;
					}
					if(pinYin==""||pinYin==null||pinYin==''){
						return false;
					}
					var array = new Array();
					array = pinYin.split(',');
					for(var k = 0; k<array.length; k++){
						var pinYinArray = new Array();
						pinYinArray = array[k].split(':');
						//为pinYinArray初始化匹配matcherArray
						var matcherArray = new Array();
						for(var i=0; i<pinYinArray.length; i++){
							matcherArray.push(new sort_.Matcher(i, -1));
						}
						for(var i=0; i<searchStr.length; i++){
							for(var j=0; j<matcherArray.length; j++){
								var indexI = parseInt(matcherArray[j].innerIndex) + 1;
								var indexO = parseInt(matcherArray[j].outerIndex);
								if(indexI!=pinYinArray[indexO].length&&searchStr.charAt(i)==pinYinArray[indexO].charAt(indexI)){
									matcherArray[j].innerIndex = indexI;
								}else{
									if(indexO!=(pinYinArray.length-1)){
										if(i!=0&&searchStr.charAt(i)==pinYinArray[indexO+1].charAt(0)){
											matcherArray[j].outerIndex = indexO + 1;
											matcherArray[j].innerIndex = 0;
										}else{
											matcherArray.splice(j, 1);
											j--;
										}
									}else{
										matcherArray.splice(j, 1);
										j--;
									}
								}
							}
							if(matcherArray.length>0){
							}else{
								break;
							}
						}
						if(matcherArray.length>0){
							return true;
						}
					}
					return false;
				},
				Matcher:function(outerIndex, innerIndex){
				       this.outerIndex = outerIndex;
				       this.innerIndex = innerIndex;
				}
		};
	//cookie
	var cookieFun = {
			init:function(){//
				resetFooter_2();
				var vCookie = $.cookie('shoppingCart');
				if(vCookie!=null&&jQuery.trim(vCookie)!=''){
					var productList = '';
					try  {
						obj = eval('(' + vCookie + ')');
						obj = cookieFun.handleNewCookie(obj);
						if(shoppingCookie.supplierId != obj.supplierId&& obj.num>0){
							var args_ = {
									div_:"<div class='Restdif'><div class='t t3empty'>"+
									"<div class='icon'></div>美食车中包含来自其他餐厅的美食"+
								"</div><div class='t2'>您需要先清空美食车才能继续挑选其他餐厅的美食</div>"+
								"<div class='actions'><div class='btn_91_28 emptyBtn f-radius-4'>清空美食车</div>"
									+"<div class='btn_91_28 backBtn f-radius-4'>返回原餐馆</div></div></div>",
									callback:function(){
										$('.Restdif .emptyBtn').click(function(){
											shoppingCookie= {
										    	supplierId:$('#i-resturant').attr('data-id'),
										    	urlName:$('#i-resturant').attr('data-url'),
										    	customerId:null,
										    	supplierName:$('#i-resturant').attr('data-name'),
										    	phoneNum:null,
										    	deliveryLeastValue:$('#i-resturant').attr('data-deliveryLeastValue'),
										    	deliveryCharge:$('#i-resturant').attr('data-deliveryCharge'),
										    	deliveryTime:$('#i-resturant').attr('data-deliveryTime'),
										    	price:0,
										    	productList:[],
										    	num:0
										    }
											listCartProducts();
											showHeaderShadowHidden();
										});
										$('.Restdif .backBtn').click(function(){
											window.location = '/'+obj.urlName;
										});
									}
							}
							showHeaderShadow(args_);
							return false;
						}else if(obj.supplierId!=null && shoppingCookie.supplierId == obj.supplierId){
							tab_.initTab();
							cartShow();
							shoppingCookie = obj;
							listCartProducts({datas:obj.productList});
							cookieFun.initNumFromCookie();
						}else if(obj.supplierId!=null){
							shoppingCookie= {
							    	supplierId:$('#i-resturant').attr('data-id'),
							    	urlName:$('#i-resturant').attr('data-url'),
							    	customerId:null,
							    	supplierName:$('#i-resturant').attr('data-name'),
							    	phoneNum:null,
							    	deliveryCharge:$('#i-resturant').attr('data-deliveryCharge'),
							    	deliveryLeastValue:$('#i-resturant').attr('data-deliveryLeastValue'),
							    	deliveryTime:$('#i-resturant').attr('data-deliveryTime'),
							    	price:0,
							    	productList:[],
							    	num:0
							    }
							cookieFun.initNumFromCookie();
						}
					}catch(exception){
						//console.log(exception);
						return;
					}

				}else{
					shoppingCookie.deliveryCharge = ($('#i-resturant').attr('data-deliveryCharge')==''||$('#i-resturant').attr('data-deliveryCharge')==null)?0:$('#i-resturant').attr('data-deliveryCharge');
					shoppingCookie.price = shoppingCookie.deliveryCharge;
				}
			},
			initNumFromCookie:function(){
				for(var k9 = 0;k9<shoppingCookie.productList.length;k9++){
					if((shoppingCookie.productList[k9].productId==null)){
					}else if((shoppingCookie.productList[k9].productId!=null)){
						$("li[product-id="+shoppingCookie.productList[k9].productId+"]",$('.m-list0')).find('a.f-radius').html(shoppingCookie.productList[k9].num);
						$("li[product-id="+shoppingCookie.productList[k9].productId+"]",$('.m-list0')).find('a.f-radius').addClass('num_not_0');
					}
				}
			},
			bindEmptyCart:function(){
				$('#clear-cart').unbind('click');//清空美食车
				$('#clear-cart').click(function(){
					shoppingCart = new ShoppingCart();
					$('#chart').empty();
					$('#total').empty();
					$('#shoppingCartTitle').html('美食车(0)');
					shoppingCart.refrushCookie();
					shoppingCart.refrushCartView();
					calAndRefrushTotal();
				});
			},
			handleNewCookie:function(cookie_args){
				  var shoppingCookie_ = {
					    	supplierId:$('#i-resturant').attr('data-id'),
					    	urlName:$('#i-resturant').attr('data-url'),
					    	customerId:null,
					    	supplierName:$('#i-resturant').attr('data-name'),
					    	phoneNum:null,
					    	deliveryCharge:$('#i-resturant').attr('data-deliverycharge'),
					    	deliveryLeastValue:$('#i-resturant').attr('data-deliveryLeastValue'),
					    	deliveryTime:$('#i-resturant').attr('data-deliveryTime'),
					    	price:0,
					    	productList:[],
					    	num:0
					    };
				shoppingCookie_.supplierId = cookie_args.supplierId;
			    shoppingCookie_.urlName = cookie_args.urlName;
			    shoppingCookie_.supplierName = $('#i-resturant').attr('data-name');
			    shoppingCookie_.deliveryCharge = $('#i-resturant').attr('data-deliverycharge');
			    shoppingCookie_.deliveryTime = $('#i-resturant').attr('data-deliveryTime');
			    shoppingCookie_.price = 0;
			    shoppingCookie_.num = 0;
			    shoppingCookie_.productList = [];
				if(cookie_args.productList!=null && cookie_args.productList.length>0){
					for(var i = 0,len = cookie_args.productList.length;i<len;i++){
						shoppingCookie_.num += cookie_args.productList[i].num;
						if(cookie_args.productList[i].id.length>1){
							var beans_0 = new Array();
							for (var int_ = 0; int_ < cookie_args.productList[i].id.length; int_++) {
								var halfs_ = {
						    		name:'',
						    		price:0,
						    		isCombine:true,
						    		num:0,
						    		productId:null,
						    		packing:0,
						    		combineList:[]
						    	};
								if($('li[product-id='+cookie_args.productList[i].id[int_]+']').length>0){
									halfs_.name = $('li[product-id='+cookie_args.productList[i].id[int_]+']').attr('product-name');
									halfs_.productId = cookie_args.productList[i].id[int_];
							    	halfs_.num = cookie_args.productList[i].num;
									shoppingCookie_.num += cookie_args.productList[i].num;
							    	halfs_.price = parseFloat($('li[product-id='+cookie_args.productList[i].id[int_]+']').attr('product-price'));
									shoppingCookie_.price = accAdd(accMul(cookie_args.productList[i].num,halfs_.price),shoppingCookie.price);
							    	halfs_.isCombine = true;
							    	halfs_.packing = $('li[product-id='+cookie_args.productList[i].id[int_]+']').attr('product-packing');

								}
								beans_0.push(halfs_);
							}

							var halfs5 = {
						    		name:'',
						    		price:0,
						    		isCombine:true,
						    		num:0,
						    		packing:0,
						    		productId:null,
						    		combineList:[]
						    	};
								halfs5.name = '';
								var aName = new Array();
								for(var j = 0;j<beans_0.length;j++){
									halfs5.name += beans_0[j].name+"+";
									aName.push(beans_0[j].name);
									halfs5.price += parseFloat(beans_0[j].price);
								}
								halfs5.isCombine = true,
								halfs5.num = cookie_args.productList[i].num;
								halfs5.name = '套餐('+aName.toString().replace(',','+')+')';
								halfs5.combineList = beans_0;
							shoppingCookie_.productList.push(halfs5);
						}else{
							var halfs_ = {
						    		name:'',
						    		price:0,
						    		isCombine:true,
						    		num:0,
						    		productId:null,
						    		packing:0,
						    		combineList:[]
						    	};
								if($('li[product-id='+cookie_args.productList[i].id[0]+']').length>0){
									halfs_.name = $('li[product-id='+cookie_args.productList[i].id[0]+']').attr('product-name');
									halfs_.productId = cookie_args.productList[i].id[0];
							    	halfs_.price = $('li[product-id='+cookie_args.productList[i].id[0]+']').attr('product-price');
							    	halfs_.num = cookie_args.productList[i].num;
							    	shoppingCookie_.num += cookie_args.productList[i].num;
							    	shoppingCookie_.price = accAdd(accMul(cookie_args.productList[i].num,halfs_.price),shoppingCookie.price);
							    	halfs_.isCombine = false;
							    	halfs_.packing = $('li[product-id='+cookie_args.productList[i].id[0]+']').attr('product-packing');
							    	shoppingCookie_.productList.push(halfs_);
								}
						}
					}
				}
				return shoppingCookie_;
			},
			cookieFormt:function(cookie_args){
				var cookie_ = {
						supplierId:cookie_args.supplierId,
						urlName :$('#i-resturant').attr('data-url'),
						productList:[]
				};
				for (var in_ = 0,len = shoppingCookie.productList.length; in_ < shoppingCookie.productList.length; in_++) {
					var temp_one = {id:[],num:0};
					temp_one.num = shoppingCookie.productList[in_].num;
					if(shoppingCookie.productList[in_].combineList!=null && shoppingCookie.productList[in_].combineList.length > 0){
						for (var int_0 = 0; int_0 < shoppingCookie.productList[in_].combineList.length; int_0++) {
							var array_element = shoppingCookie.productList[in_].combineList[int_0];
							temp_one.id.push(shoppingCookie.productList[in_].combineList[int_0].productId);
						}
					}else{
						temp_one.id.push(shoppingCookie.productList[in_].productId);
					}
					cookie_.productList.push(temp_one);
				}
				return cookie_;
			}
	};
	cookieFun.init();
	menu.init();
    // 点击列表增加商品
    $shop.click(function (){
        var n = $numall.text();
        if( n != 0){
            $body.slideToggle("slow");
        }
    });

    initEvent();
	function initEvent(){
		function initMenuList(){
			$("#list-detail").find('a').each(function(){
				$(this).click(function(){
					if($('a[name='+$(this).attr('title')+']').length>0){
						$('html,body').animate({scrollTop:$('a[name='+$(this).attr('title')+']').offset().top},500);
					}
				});
			});
			$(".m-nav").find('a').each(function(){
				$(this).click(function(){
					$(this).attr('title')
					if($('a[name='+$(this).attr('title')+']').length>0){
						$('html,body').animate({scrollTop:$('a[name='+$(this).attr('title')+']').offset().top},500);
					}
				});
			});
		}
		initMenuList();
		favor_.selectFavor({supplierid:$('#i-resturant').attr('data-id')});

		$("#Pagination").removeClass("left-db");
		$("#Pagination1").removeClass("left-db");
		initShoppingCartH();
		if($('#i-resturant').attr('data-serviceStatus')=="2"){
			$(".notice1").css('textAlign','center');
		}
		$('.hod3:last-child').css({borderBottom:'none'});
		var rest = false;
		var now = new Date();
		var hour = now.getHours();
		var minute = now.getMinutes();

		var openTimePm = $('#i-resturant').attr("data-openTimePm");
		var closeTimePm = $('#i-resturant').attr("data-closeTimePm");
		var openTimeAm = $('#i-resturant').attr("data-openTimeAm");
		var closeTimeAm = $('#i-resturant').attr("data-closeTimeAm");

		var sHourO1 = parseInt(openTimePm.substr(0,openTimePm.indexOf(':')), 10);
		var sMinuteO1 = parseInt(openTimePm.substr(openTimePm.indexOf(':')+1, openTimePm.length), 10);
		var sHourC1 = parseInt(closeTimePm.substr(0,closeTimePm.indexOf(':')), 10);
		var sMinuteC1 = parseInt(closeTimePm.substr(closeTimePm.indexOf(':')+1, closeTimePm.length), 10);
		var sHourO2 = parseInt(openTimeAm.substr(0,openTimeAm.indexOf(':')), 10);
		var sMinuteO2 = parseInt(openTimeAm.substr(openTimeAm.indexOf(':')+1, openTimeAm.length), 10);
		var sHourC2 = parseInt(closeTimeAm.substr(0,closeTimeAm.indexOf(':')), 10);
		var sMinuteC2 = parseInt(closeTimeAm.substr(closeTimeAm.indexOf(':')+1, closeTimeAm.length), 10);

			if(((sHourC1>hour||(sHourC1==hour&&sMinuteC1>=minute))&&(sHourO1<hour||(sHourO1==hour&&sMinuteO1<=minute))) || ((sHourC2>hour||(sHourC2==hour&&sMinuteC2>=minute))&&(sHourO2<hour||(sHourO2==hour&&sMinuteO2<=minute)))){
				rest = false;
			}else{
				rest = true;
			}

		if($('#i-resturant').attr('data-serviceStatus') == '2' || rest == true){
			$('#status_resturant').html('店铺休息');
		}

		var btn = {
				countStatus:true,//升序
				priceStatus:false//降序
		};
		$('#supplierName_span').click(function(){
			$('#id-menu-item').click();
		});
		$('.l-xl').click(function(){
			$('.l-xl').removeClass('hover2');
			if($.trim($(this).text()).indexOf('销量')>-1){
				$('.item-sales').addClass('hover2');
				sort_.byNumPirceDefault({type:'product-buycount'});
			}else if($.trim($(this).text()).indexOf('价格')>-1){
				$('.item-price').addClass('hover2');
				sort_.byNumPirceDefault({type:'product-price'});
			}else if($.trim($(this).text()).indexOf('默认排序')>-1){
				$('.item-default').addClass('hover2');
				sort_.byNumPirceDefault({type:'product-time'});
			}
		});
		$('#supplierName_').click(function(){
			$('#i-nav a[tab-tag=menu]').click();
		});
		$('.l-xl').hover(function(){
			if($.trim($(this).text()).indexOf('价格')>-1){
				$(this).find('i').addClass('class_up_hover');
			}else if($.trim($(this).text()).indexOf('销量')>-1){
				$(this).find('i').addClass('class_down_hover');
			}

		},function(){
			if($.trim($(this).text()).indexOf('价格')>-1){
				$(this).find('i').removeClass('class_up_hover');
			}else if($.trim($(this).text()).indexOf('销量')>-1){
				$(this).find('i').removeClass('class_down_hover');
			}
		});
		var element = document.getElementById("searchInput");
	    if("\v"=="v") {
	        element.onpropertychange = webChange;
	    }else{
	        element.addEventListener("input",function(){
	        	sort_.search_('searchInput');
	        	$('#searchInput2').val($('#searchInput').val());
	        },false);
	    }
	    var elementd = document.getElementById("searchInput2");
	    if("\v"=="v") {
	        elementd.onpropertychange = webChange2;
	    }else{
	        elementd.addEventListener("input",function(){
	        	sort_.search_('searchInput2');
	        	$('#searchInput').val($('#searchInput2').val());
	        },false);
	    }
	    function webChange(){
	    	sort_.search_('searchInput');
	    }
	    function webChange2(){
	    	sort_.search_('searchInput2');
	    }

	    newShop.submitOrders();//init submit orders
	}

    var num = $(".js-list").length;
    var sc0 = $(".js-list:eq(0)").offset().top;
	var cart_ = {
			stop_:function(){
				 if($(window).scrollTop()+$(window).height()>$('.footer').offset().top){
			         	$('#m-cart').css({'position':'relative','bottom':'0'});
		         }else{
		         	$('#m-cart').css({'position':'fixed','bottom':'0'});
		         }
			},
			initPage:function(){
				if(($('.footer').offset().top+130)<=$(window).height()){
					$('.m-cart').css({'position':'absolute','bottom':($(window).height()-$('.footer').offset().top)});
				}
			}
	};
	cart_.stop_();
	cart_.initPage();
    var timeout_ = false;
    $(window).scroll(function(){
        var $mTop = $(".m-top"),$mTop_title = $(".m-top .title");
        if( $(window).scrollTop() > sc0 ){
            $mTop.addClass("fixer");
            $mTop.removeClass("f-dn");
            $listDetail.css({"display":"none"});
        }
        if( $(window).scrollTop() > sc0 ){
        	$mTop.addClass("fixer");
            for(var k5 = 0;k5 < $('.js-list .title').length;k5++){
            	if($('.js-list .title:eq('+k5+')').offset().top>$(window).scrollTop()){
            		$('.fixer .title').html($('.js-list .title:eq('+(--k5)+')').html());
            		break;
            	}
    		}
        }
         cart_.stop_();
         var top_cart = $('#m-cart').offset().top,top_foot = $('.footer').offset().top;
         if(($('.halfCombine').length>0)&&($('.m-halfcombine2').length> 0)){
        	 if(( $(window).scrollTop() > $('.halfCombine').offset().top )&& (($('.m-halfcombine2').offset().top+$('.m-halfcombine2').height())>$(window).scrollTop())){
            	 $('.halfCombine .halfCombine21').addClass('combineHalf12');
             }else{
            	 if($('.halfCombine .halfCombine21').hasClass('combineHalf12')){
            		 $('.halfCombine .halfCombine21').removeClass('combineHalf12');
            	 }
             }
         }
        if( $(window).scrollTop() < sc0 ){
            $mTop.removeClass("fixer");
            $mTop.addClass("f-dn");
        }
        var $height = ($("#i-panel-menu").top+$("#i-panel-menu").height);
        if($height>$(window).scrollTop){
        	$mTop.css({top:$height})
        }
        if($(window).scrollTop() > $(".left-menus").offset.top){
        }
        if( $(window).scrollTop() > 10){
        	$("#i-toTop").addClass("toTop-db");
        }else{
        	$("#i-toTop").removeClass("toTop-db");
        }
    });
    function Product(){
    	this.name = null;
    	this.price = 0;
    	this.isCombine = false;
    	this.num = 0;
    	this.productId = null;
    	this.combineList = null;
    	this.packing = 0;
    }
    /**
     * 商品抛物线进入购物车 BEGIN
    ------------------------------------------------------*/
    //清空购物车
    clearCart();
    function clearCart(){
    	$('#clear-cart').click(function(){
    		$('#m-cart ul').html('');
    		shoppingCookie.productList = [];
    		$('#totalValue').html('￥0');
    		$.cookie('shoppingCart', null, { path: '/', expires: 0 });
    		$('#shoppingCartTitle').html('美食车(0)');
    		$('.numCart').html(0);
    		/* $('.l-list').each(function(){
				  $(this).find('.num a').removeClass('num_not_0');
				  $(this).find('.num a').html('');
			  }); */
    		for(var i = 0,len = $('.l-list').length;i<len;i++){
    			$('.l-list').eq(i).find('.num a').removeClass('num_not_0');;
    			$('.l-list').eq(i).find('.num a').html('');;
    		}
    		/* $('.l-list').each(function(){
				  $(this).find('.num a').removeClass('num_not_0');
				  $(this).find('.num a').html('');
			  }); */
    		$("#m-cart-title").css({'display':'none'});
    		$('#submitOrder').removeClass('btn-success').addClass('sendTips').html("还差"+{{$stores->qsjg}}+"元起送");
    		$('#m-cart ul').css({'height': 'auto','overflow': 'hidden'});
    	});
    }

/*-------------------------------------------列出商品start----------------------------------------*/

	function listCartProducts(args){
		cartShow();
		var sH = '';
		var totalValue = 0,val_num = 0,packingTotalValue = 0;
		var k0_  = -1;


		for(var k0 = 0;k0<shoppingCookie.productList.length;k0++){
			if(shoppingCookie.productList[k0].num==0){
				k0_ = k0;
			}else{
				val_num += parseInt(shoppingCookie.productList[k0].num);
				var product_ids = '';
				if(shoppingCookie.productList[k0].productId==null){
					for (var int_ = 0; int_ < shoppingCookie.productList[k0].combineList.length; int_++) {
						product_ids += (int_==0?"":"|")+shoppingCookie.productList[k0].combineList[int_].productId;
					}
				}else{
					product_ids = shoppingCookie.productList[k0].productId;
				}
				sH += "<li product-ids='"+product_ids+"'><div class='name f-fl' title=\""+shoppingCookie.productList[k0].name+"\">"+shoppingCookie.productList[k0].name+"</div>"+
	               "<div class='num f-fl'><i class='plus f-all'></i><input type='text'  onkeyup=\"this.value=this.value.replace(/\\D/g,'');this.value=this.value==''?1:this.value\" onafterpaste=\"this.value=this.value.replace(/\\D/g,'');this.value=this.value==''?1:this.value\"  value='"+shoppingCookie.productList[k0].num+"' size='4' class='f-tac f-14 f-radius num-0'><i class='minus f-all'></i></div>";
	               var c = accMul(parseFloat(shoppingCookie.productList[k0].price),parseInt(shoppingCookie.productList[k0].num))
	               c = ((c+'').indexOf(".")>-1)?c:c+".0";
	            sH   += "<div class='price f-frs' title="+c+">￥"+c+"</div></li>";
	               totalValue = accAdd(totalValue,  accMul(parseFloat(shoppingCookie.productList[k0].price),parseInt(shoppingCookie.productList[k0].num)));
	               packingTotalValue = accAdd(packingTotalValue,  accMul(parseFloat(shoppingCookie.productList[k0].packing),parseInt(shoppingCookie.productList[k0].num)));
			}
		}


		if(k0_!=-1){
			shoppingCookie.productList.splice(k0_,1);
		}
		var p_ = packingTotalValue;
		p_ = ((p_+'').indexOf(".")>-1)?p_:(p_+".0");
		$('.boxtotalprice').html("￥"+p_);
		if(val_num==0){
			$("#m-cart-title").css({'display':'none'});
		}else{
			$("#m-cart-title").css({'display':'block'});
		}
		$('.numCart').html(val_num);
		$('#shoppingCartTitle').html('美食车(' + val_num + ')');

		$('#m-cart ul').html(sH);
		totalValue += parseFloat(packingTotalValue)+parseFloat(shoppingCookie.deliveryCharge)
		  totalValue = ((totalValue+'').indexOf(".")>-1)?totalValue:totalValue+".0";
		totalValue = (val_num==0)?0:totalValue;
		$('#totalValue').html('￥'+totalValue);
		var s9 = totalValue-parseFloat({{$stores->qsjg}});
		s9 = (s9<0?(s9*(-1)):s9);
		if(totalValue-parseFloat({{$stores->qsjg}})>=0){
			$('#submitOrder').removeClass('sendTips').addClass('btn-success').html("去结算");
		}else{
			$('#submitOrder').removeClass('btn-success').addClass('sendTips').html("还差"+s9+"元起送");
		}
		initShoppingCartH();
		resizeCartUl();
		newShop.inputNum();
		newShop.minusPlus();
		shoppingCookie.num = val_num;
		shoppingCookie.price = totalValue;
		var cookie_ = cookieFun.cookieFormt(shoppingCookie);
		$.cookie('shoppingCart', JSON.stringify(cookie_), { path: '/', expires: 60*60*12 });
		cookieFun.initNumFromCookie()
	}

/*-------------------------------------------列出商品end----------------------------------------*/

	function resizeCartUl(){
		$('#m-cart ul').resize(function(){
			if($(this).height()>500){
				$(this).css({height:500,overflow:'auto'});
			}else{
				$(this).css({height:'auto',overflow:'auto'});
			}
		});
	}
	function halfIsExists(arg){
    	var flag = false;
   		for(var i =0;i<arg.bean.length;i++){
       		if(arg.id==arg.bean[i].productId){
       			flag = true;
       			break;
       		}
       	}
    	return flag;
    }
    function halfIsExist(arg){
    	var flag = false;
    	if(shoppingCookie.productList!=null){
    		for(var i =0;i<shoppingCookie.productList.length;i++){
        		if(arg.id==shoppingCookie.productList[i].productId){
        			flag = true;
        			break;
        		}
        	}
    	}
    	return flag;
    }
    function changeHalfCombineListIsExistNums(arg){
    	if(shoppingCookie.productList!=null){
    		for(var i =0;i<shoppingCookie.productList.length;i++){
        		if(arg.id==shoppingCookie.productList[i].productId){
        			shoppingCookie.productList[i].num += 1;
        		}
        	}
    	}
    }
    //购物车动画
    function cartShow(){
    	$('#m-cart > div').css({display:'block'});
    	$('.go-orders').addClass('go-orders-db');
    	$('.go-orders').click(function(){
    	});
    }
    var array_ = {
    		compare:function(args0,args1){
    			var is_ = {
    					isExisting : false,
    					index:-1};
    			var arr_args0 = array_.getIDArray(args0.combineList);
    			for(var i = 0;i<args1.length;i++){
    				if(args1[i].isCombine){
    					var arr_args1 = array_.getIDArray(args1[i].combineList);
    					if(arr_args1 == arr_args0){
    						is_.isExisting = true;
    						is_.index = i;
    						break;
    					}else{
    						is_.isExisting = false;
    					}
    				}
    			}
    			return is_;
    		},
    		contain_:function(arr,a){
    			var existing = false;
    			for(var j = 0;j < arr.length;j++){
    				if(a.productId == arr[j].productId){
						existing = true;
						break;
					}
    				existing = false;
    			}
    			return existing;
    		},
    		getIDArray:function(arr){
    			var arr_ = new Array();
    			for(var i = 0;i<arr.length;i++){
    				arr_.push(arr[i].productId);
    			}
    			return arr_.sort().join('-');
    		}
    };
    //
    halfToCart();
	function halfToCart(){
		$('.addCombine').click(function(){
			cartShow();
			if(bean.half.length<2){
				var args_ = {
						div_:"<div class='Restdif'><div class='t'>"+
						"<div class='t23'>套餐需要2-3菜品个组合哦！</div>"+
					"<div class='actions'><div class='btn_91_28 f-radius-4 f-fr ok23'>确定</div></div></div>",
						callback:function(){
							$('.Restdif .ok23').click(function(){
								showHeaderShadowHidden();
							});
						}
				}
				showHeaderShadow(args_);
			}else if(bean.half.length > 1){
				var halfs = {
		    		name:'',
		    		price:0,
		    		isCombine:true,
		    		num:0,
		    		packing:0,
		    		productId:null,
		    		combineList:[]
		    	};
				halfs.name = '';
				var aName = new Array();
				for(var j = 0;j<bean.half.length;j++){
					halfs.name += bean.half[j].name+"+";
					aName.push(bean.half[j].name);
					halfs.price += parseFloat(bean.half[j].price);
				}
				halfs.isCombine = true,
				halfs.num = 1;
				$('.combineText_checkbox').removeClass('combineText_checkbox_hover');
				halfs.name = '套餐('+aName.toString().replace(',','+')+')';
				halfs.combineList = bean.half;
				bean.half = [];
				var isEX = array_.compare(halfs, shoppingCookie.productList);
				if(isEX.isExisting){
					shoppingCookie.productList[isEX.index].num += 1;
				}else{
					shoppingCookie.productList.push(halfs);
				}
				$('#combineProduct').html('例如：辣子鸡块+宫保鸡丁=10元').attr('title','例如：辣子鸡块+宫保鸡丁=10元');
	             var id_randow = "R"+Math.random();
	             id_randow = (id_randow+"").replace('0.','');
	             $('<div>',{
	          	   id:id_randow,
	          	   'class':'u-ball'
	             }).text('1').insertBefore($('body'));

	  			var targetCar = document.getElementById("m-cart");
	               element = document.getElementById(id_randow);

	               $("#"+id_randow).css({
	                   top: this.getBoundingClientRect().top,
	                   left: this.getBoundingClientRect().left,
	                   display:'block'
	              });

	            var parabola = funParabola(element, targetCar).mark();
	            element.style.marginTop = "0px";
	            //parabola.init();
	            //var parabola = funParabola(element, targetCar).mark();
	            parabola.init();
				listCartProducts({datas:bean.halfCombineList});
			}
		});
	}
	$('li.f-dztj .addones').each(function(){
		$(this).click(function(){
			$(this).closest('li');
			if(!halfIsExist({id:$(this).closest('li').attr('product-id'),bean:shoppingCookie.productList})){
				var pHalf = new Product();
				pHalf.name = $(this).closest('li').attr('product-name');
				pHalf.price = $(this).closest('li').attr('product-price');
				pHalf.isCombine = false;
				pHalf.num = 1;
				pHalf.productId = $(this).closest('li').attr('product-id');
				pHalf.packing = $(this).closest('li').attr('product-packing');
				shoppingCookie.productList.push(pHalf);
			}else{
				changeHalfCombineListIsExistNums({id:$(this).closest('li').attr('product-id')});
			}

			 this.getBoundingClientRect();
             var id_randow = "R"+Math.random();
             id_randow = (id_randow+"").replace('0.','');
             $('<div>',{
          	   id:id_randow,
          	   'class':'u-ball'
             }).text('1').insertBefore($('body'));

  			var targetCar = document.getElementById("m-cart");
               element = document.getElementById(id_randow);

            $("#"+id_randow).css({
                 top: this.getBoundingClientRect().top,
                 left: this.getBoundingClientRect().left,
                 display:'block'
            });

            var parabola = funParabola(element, targetCar).mark();
            element.style.marginTop = "0px";
            parabola.init();
            var parabola = funParabola(element, targetCar).mark();
            parabola.init();

			listCartProducts();

		});
	});
	function initTips(){
		var name_ = '',price_ = 0;
		for(var k1 = 0;k1<bean.half.length;k1++){
			price_ += parseFloat(bean.half[k1].price);
			if(k1!=0){
				name_ += '+'+bean.half[k1].name;
			}else{
				name_ += bean.half[k1].name;
			}
		}
		if(name_==''){
			$('#combineProduct').html('例如：辣子鸡块+宫保鸡丁=10元').attr('title','例如：辣子鸡块+宫保鸡丁=10元');
		}else{
			$('#combineProduct').html('套餐('+name_+')='+price_+'元').attr('title','套餐('+name_+')='+price_+'元');
		}
	}
	var args_checed = {
			flag:false
	};
	$('.l-list').find('input[type=checkbox]').each(function(){
		 $(this).click(function(e){
			 e.preventDefault();
		 });
	 });

	for(var i_0 = 0,len_0 = $('.l-list').length;i_0 < len_0;i_0++){
		$('.l-list').eq(i_0).click(function(){
			if(($(this).find('.cart').length>0)&&$(this).find('.cart').text()!=null){
 	        	if(($(this).find('.cart').text().indexOf('休息')>-1)||($(this).find('.cart').text().indexOf('已')>-1)){
 	        		return false;
 	        	}
 	        }
 			if($(this).find('.name').html().indexOf('手机端专享')>-1){
 				var args_ = {
 						div_:"<div class='Restdif'><div class='f-all codemobile' ></div><div><div class='t rmobit'>"+
 						"<div class='t23'>该活动菜品只能在<span class='appmobile'>【飞饭手机端】</span>购买</div>"+
 					"<div class='actions'><div class='btn_91_28 f-radius-4 f-fr okmobile'>继续点餐</div></div></div></div>",
 						callback:function(){
 							$('.Restdif .okmobile').click(function(){
 								showHeaderShadowHidden();
 							});
 						}
 				}
 				showHeaderShadow(args_);
 				return false;
 			}else if($(this).closest('.m-halfcombine2').length == 1){//半价组合

 				if(halfIsExists({id:$(this).attr('product-id'),bean:bean.half})){
 					for(var i = 0;i<bean.half.length;i++){
 						if(bean.half[i].productId==$(this).attr('product-id')){
 							bean.half.splice(i, 1);
 							$(this).find('.combineText_checkbox').removeClass('combineText_checkbox_hover')
 							flag_ = true;
 							break;
 						}
 					}
 					initTips();
 					return false;//
 				}else if(bean.half.length > 2){
 					var args_ = {
								div_:"<div class='Restdif'><div class='t'>"+
								"<div class='t23'>组合菜最多由三份组合而成哦！</div>"+
							"<div class='actions'><div class='btn_91_28 f-radius-4 f-fr ok23'>确定</div></div></div>",
								callback:function(){
									$('.Restdif .ok23').click(function(){
										showHeaderShadowHidden();
									});
								}
						};
						showHeaderShadow(args_);
 					return false;
 				}else if(!halfIsExists({id:$(this).attr('product-id'),bean:bean.half})){
	    				var pHalf = new Product();
	    				pHalf.name = $(this).attr('product-name');
	    				pHalf.price = $(this).attr('product-price');
	    				pHalf.packing = $(this).attr('product-packing');
	    				pHalf.isCombine = true;
	    				pHalf.num = 1;
	    				pHalf.productId = $(this).attr('product-id');
	    				var combineFlag = true;
	    				if($(this).find('.combineText_checkbox').hasClass('combineText_checkbox_hover')){

	    					$(this).find('.combineText_checkbox').removeClass('combineText_checkbox_hover');
	    					var k1_ = -1;
	    					for(var k1 = 0;k1<bean.half.length;k1++){
		    					if(bean.half[k1].productId==$(this).attr('product-id')){
		    						k1_ = k1;
		    						combineFlag = true;
		    					}
		    				}
	    					if(k1_!=-1){
		    					bean.half.splice(k1_,1);
	    					}
	    					return;
	    				}else{
		    				$(this).find('.combineText_checkbox').addClass('combineText_checkbox_hover');
		    				bean.half.push(pHalf);
	    				}
	    				initTips();
	    				return false;
	    			}
 			}else{
 				if(!halfIsExist({id:$(this).attr('product-id'),bean:shoppingCookie.productList})){
 					var pHalf = new Product();
     				pHalf.name = $(this).attr('product-name');
     				pHalf.price = $(this).attr('product-price');
     				pHalf.isCombine = false;
     				pHalf.num = 1;
     				pHalf.packing = $(this).attr('product-packing');
     				pHalf.productId = $(this).attr('product-id');
     				shoppingCookie.productList.push(pHalf);
 				}else{
 					changeHalfCombineListIsExistNums({id:$(this).attr('product-id')});
 				}
 				if($(this).children(".num").children("a").html()!=''){
 					$(this).children(".num").children("a").html(parseInt($(this).children(".num").children("a").html())+1);
 				}else{
 					$(this).children(".num").children("a").html(1);
 				}
 				$(this).children(".num").children("a").addClass("num_not_0");
 				listCartProducts({datas:bean.halfCombineList});
 			}

            this.getBoundingClientRect();
            var id_randow = "R"+Math.random();
            id_randow = (id_randow+"").replace('0.','');
            $('<div>',{
         	   id:id_randow,
         	   'class':'u-ball'
            }).text('1').insertBefore($('body'));

 			var targetCar = document.getElementById("m-cart");
              element = document.getElementById(id_randow);

            $("#"+id_randow).css({
                top: $(this).find(".f-radius")[0].getBoundingClientRect().top,
                left: $(this).find(".f-radius")[0].getBoundingClientRect().left,
                display:'block'
            });

            var parabola = funParabola(element, targetCar).mark();
            $(this).find(".f-radius")[0].style.marginLeft = "0px";
            element.style.marginTop = "0px";

            var parabola = funParabola(element, targetCar).mark();
            parabola.init();
		});
	}



    (function() {
        var lastTime = 0;
        var vendors = ['webkit', 'moz'];
        for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
            window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
            window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||    // name has changed in Webkit
                window[vendors[x] + 'CancelRequestAnimationFrame'];
        }

        if (!window.requestAnimationFrame) {
            window.requestAnimationFrame = function(callback, element) {
                var currTime = new Date().getTime();
                var timeToCall = Math.max(0, 16.7 - (currTime - lastTime));
                var id = window.setTimeout(function() {
                    callback(currTime + timeToCall);
                }, timeToCall);
                lastTime = currTime + timeToCall;
                return id;
            };
        }
        if (!window.cancelAnimationFrame) {
            window.cancelAnimationFrame = function(id) {
                clearTimeout(id);
            };
        }
    }());
    /*
     * 商品抛物线进入购物车 END
    ------------------------------------------------------*/

    /**
     * 餐厅抬头固定 BEGIN
    ------------------------------------------------------*/
   /*  $.browser.msie = /msie/.test(navigator.userAgent.toLowerCase());
    if($.browser.msie&&$.browser.version=="7.0"){
        $(".triangle").remove();
    } */
    $("#menu-catalog").click(function(){
        if($listDetail.css("display")==="none"){
            $listDetail.fadeIn();
        }else{
            $listDetail.hide();
        }
    });
    /**
     * 餐厅抬头固定 END
     ------------------------------------------------------*/

	//留言验证码
	checkCode();
	function checkCode(){
		$('#change_captha_img').click(
				function(){
					$('#captha_img').attr('src', '/captcha_signup.jpg?' + Math.floor(Math.random()*100) );
				}
		);
	}
	//半份合并
	function halfCombine(){
		//Half Combine
		$('.halfCombine ~ .item').click(function(){
			var cb = $(this).find('input[type=checkbox]');
			if(!cb.prop('checked')){
				if($('.halfCombine').parent().find('[name=half]:checked').length>=3){
					dialog.create({
						text: '组合菜最多由三份组合而成哦！',
						type: 'alert',
						data: null,
						ok: function(d) {
						},
						cancel: function(d) {
						}
						});
					return;
				}
				cb.prop('checked', true);
			}else{
				cb.prop('checked', false);
			}
		});
	}
	halfCombine();
	popHiden();
	function popHiden(){
		$('#goon,#ok_2').click(function(){
			hideOverlay();
		});
		$('#overlay').click(function(){
			hideOverlay();
		});
	}
	var defaultArgs = {
			block:{display:"block"},
			none:{display:"none"}
	}
	function showOverlay(args){
	    $("#overlay").fadeIn();
	    $("#olContent").fadeIn();
	    $('.dialog-item').removeClass('f-db-dialog');
	    $('.'+args.class_).addClass('f-db-dialog');
	    if(args.text_!=undefined){
	    	$('#text_').html(args.text_);
	    }
	}
	// 隐藏遮罩
	function hideOverlay(){
	    $("#olContent").fadeOut();;
	    $("#overlay").fadeOut();
	}
})();

//半分合并
function combineProductInit(){
	var combineProducts = $('.combType');

	var combines = $('.combine').filter('.item');
	if(combines.length == 0){
		$('#halfNav').parent('li').remove();
		$('#halfHref').next('.title').remove();
		$('#halfHref').next('.block').remove();
		$('#halfHref').remove();
	}

	$('.halfCombine').find('.addCombine').click(function(){
		var supplierId = $('#supplierId').val();
		if(shoppingCart.supplierId!=null&&shoppingCart.supplierId!=supplierId){
			if(window.confirm("您一个订单只能选择一个餐馆的菜，确定要删除之前选的菜吗？")){
				$.cookie('shoppingCart', null, {path: '/'});
				shoppingCart = new ShoppingCart();
				shoppingCart.supplierId = supplierId;
				shoppingCart.urlName = $('#urlName').val();;
				shoppingCart.supplierName = $('#companyName').val();
				shoppingCart.deliveryCharge = ($('#deliveryCharge').val()==''||$('#deliveryCharge').val()==null||typeof $('#deliveryCharge') == 'undefined')?0:$('#deliveryCharge').val();
	        }else{
	            return;
	        }
		}
		var products = $('.halfCombine').parent().find('[name=half]:checked');
		if(products.length == 0){
			$('#combineProduct').html('例如：辣子鸡块+宫保鸡丁=10元').attr('title','例如：辣子鸡块+宫保鸡丁=10元');
			return;
		}
		if(products.length == 1){
			dialog.create({
				text: '套餐需要2-3菜品个组合哦！',
				type: 'alert',
				data: null,
				ok: function(d) {
				},
				cancel: function(d) {
				}
				});
			return;
		}

		var product = new Product();
		product.isCombine = true;
		product.combineList = new Array();
		var productName = new Array();
		var productPrice = 0;
		for(var i=0; i<products.length; i++){
			productName.push($(products[i]).parent().parent().find('.name').text());
			productPrice = accAdd(productPrice,$(products[i]).parent().parent().find('.PPrice').val());
			var innerProduct = new Product();
			innerProduct.name = $(products[i]).parent().parent().find('.PName').val();
			innerProduct.price = $(products[i]).parent().parent().find('.PPrice').val();
			innerProduct.productId = $(products[i]).parent().parent().find('.productId').val();
			innerProduct.isCombine = $(products[i]).parent().parent().find('.combType').val() == '1'?true:false;
			innerProduct.num = 1;
			product.combineList.push(innerProduct);
		}
		productName.sort();
		var name = '套餐（';
		for(var i=0; i<productName.length; i++){
			name += productName[i];
			name += '+';
		}
		name = name.substring(0, name.length-1);
		name += '）';
		product.name = name;
		product.price = productPrice;
		product.num = 1;

		var productList = shoppingCart.productList;
		if(productList == null || productList.length == 0){
			productList = new Array();
			productList.push(product);
			shoppingCart.productList = productList;
		}else{
			var isIn = false;
			for(var i=0; i<productList.length; i++){
				if(productList[i].isCombine == true && productList[i].name == product.name){
					productList[i].num = parseInt(productList[i].num) + 1;
					isIn = true;
					break;
				}
			}
			if(!isIn){
				productList.push(product);
			}
		}
		calAndRefrushTotal();
		shoppingCart.refrushCookie();
		shoppingCart.refrushCartView();
		for(var i=0; i<products.length; i++){
			$(products[i]).prop('checked', false);
		}
		$('#combineProduct').html('例如：辣子鸡块+宫保鸡丁=10元').attr('title','例如：辣子鸡块+宫保鸡丁=10元');;
		combineProductName = productName.join('+');
	});
}
</script>
<form action="shoppingcart" method="post">
	<input type="hidden" name="test1" value="testvalue">
</form>
</body>
</html>
